job-flake-update: init

This commit is contained in:
DavHau 2023-07-26 19:49:17 +02:00
parent 119423deb5
commit eb321e4f05
3 changed files with 43 additions and 0 deletions

View 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;
};
}

View 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

View File

@ -45,6 +45,7 @@
./flake-parts/action-checkout
./flake-parts/action-flake-update
./flake-parts/action-create-pr
./flake-parts/job-flake-update
./targets/flake-module.nix
./modules/flake-module.nix
./pkgs/flake-module.nix