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
|
@ -45,6 +45,7 @@
|
|||||||
./flake-parts/action-checkout
|
./flake-parts/action-checkout
|
||||||
./flake-parts/action-flake-update
|
./flake-parts/action-flake-update
|
||||||
./flake-parts/action-create-pr
|
./flake-parts/action-create-pr
|
||||||
|
./flake-parts/job-flake-update
|
||||||
./targets/flake-module.nix
|
./targets/flake-module.nix
|
||||||
./modules/flake-module.nix
|
./modules/flake-module.nix
|
||||||
./pkgs/flake-module.nix
|
./pkgs/flake-module.nix
|
||||||
|
Loading…
Reference in New Issue
Block a user