add actions and jobs for automatic updates #38

Merged
clan-bot merged 11 commits from actions into main 2023-07-28 12:03:45 +00:00
3 changed files with 43 additions and 1 deletions
Showing only changes of commit 7f2982bb66 - Show all commits

View File

@ -0,0 +1,25 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.tea
pkgs.openssh
]
''
bash ${./script.sh} "$@"
'';
in
{
packages.${name} = script;
};
}

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
REMOTE_BRANCH="${REMOTE_BRANCH:-auto-pr}"
PR_TITLE="${PR_TITLE:-'This PR was created automatically'}"
git diff --quiet || {
echo -e "\e[31mWorking tree is dirty, please commit first\e[0m"
git status
exit 1
}
git push origin "HEAD:$REMOTE_BRANCH"
tea pr create "$@" \
--head "$REMOTE_BRANCH" \
--title "$PR_TITLE"

View File

@ -43,7 +43,7 @@
inputs.treefmt-nix.flakeModule
inputs.clan-core.modules.flake-parts.writers
./flake-parts/action-flake-update
./flake-parts/action-open-pull-request
./flake-parts/action-create-pr
./targets/flake-module.nix
./modules/flake-module.nix
./pkgs/flake-module.nix