clan-infra/pkgs/action-flake-update-pr-clan/script.sh

23 lines
864 B
Bash
Raw Normal View History

2023-07-26 17:49:17 +00:00
#!/usr/bin/env bash
set -euo pipefail
# prevent these variables from being unset by writePureShellScript
export KEEP_VARS="GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GITEA_URL GITEA_USER PR_TITLE REMOTE_BRANCH REPO_DIR${KEEP_VARS:+ $KEEP_VARS}"
2023-07-26 17:49:17 +00:00
# configure variables for actions
export PR_TITLE="Automatic flake update - $(date --iso-8601=minutes)"
export REMOTE_BRANCH="flake-update-$(date --iso-8601)"
export REPO_DIR=$TMPDIR/repo
2023-07-28 11:25:30 +00:00
export GIT_AUTHOR_NAME="Clan Merge Bot"
export GIT_AUTHOR_EMAIL="clan-bot@git.clan.lol"
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_NAME"
export GITEA_USER="clan-bot"
export GITEA_URL="https://git.clan.lol"
2023-07-26 17:49:17 +00:00
2023-08-03 14:55:53 +00:00
git clone --depth 1 --branch main "$REPO" "$REPO_DIR"
cd "$REPO_DIR"
2023-07-28 11:25:30 +00:00
action-ensure-tea-login
2023-07-26 17:49:17 +00:00
action-flake-update
2023-07-28 11:25:30 +00:00
action-create-pr --assignees clan-bot