forked from clan/clan-infra
job-flake-update: init
This commit is contained in:
parent
119423deb5
commit
eb321e4f05
26
flake-parts/job-flake-update/default.nix
Normal file
26
flake-parts/job-flake-update/default.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
perSystem =
|
||||
{ config
|
||||
, pkgs
|
||||
, self'
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
name = builtins.baseNameOf ./.;
|
||||
script = config.writers.writePureShellScriptBin
|
||||
name
|
||||
[
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
self'.packages.action-checkout
|
||||
self'.packages.action-flake-update
|
||||
self'.packages.action-create-pr
|
||||
]
|
||||
''
|
||||
bash ${./script.sh}
|
||||
'';
|
||||
in
|
||||
{
|
||||
packages.${name} = script;
|
||||
};
|
||||
}
|
16
flake-parts/job-flake-update/script.sh
Normal file
16
flake-parts/job-flake-update/script.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# prevent these variables from being unset by writePureShellScript
|
||||
export KEEP_VARS="PR_TITLE REMOTE_BRANCH REPO REPO_DIR"
|
||||
|
||||
# configure variables for actions
|
||||
export PR_TITLE="Automatic flake update - $(date --iso-8601=minutes)"
|
||||
export REMOTE_BRANCH="flake-update-$(date --iso-8601)"
|
||||
export REPO=gitea@git.clan.lol:clan/clan-infra.git
|
||||
export REPO_DIR=$TMPDIR/repo
|
||||
|
||||
action-checkout
|
||||
cd $REPO_DIR
|
||||
action-flake-update
|
||||
action-create-pr
|
Loading…
Reference in New Issue
Block a user