From 7b54db315d423f03c3d3249db6cb31962f547cee Mon Sep 17 00:00:00 2001 From: Jess Date: Sun, 29 Dec 2024 18:31:50 +1300 Subject: [PATCH] ci: init auto flake update action --- .github/workflows/update.yaml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/update.yaml diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml new file mode 100644 index 0000000..810dde1 --- /dev/null +++ b/.github/workflows/update.yaml @@ -0,0 +1,39 @@ + +name: Update Flake Inputs + +on: + workflow_dispatch: + schedule: + # https://crontab.guru/#0_13_*_*_wed + - cron: "0 13 * * wed" + +jobs: + build: + runs-on: nix + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Flake update + run: nix flake update + + - name: Set Git user + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Git commit + run: | + git add -A + if [[ `git status --porcelain` ]]; then + git commit -m "flake: update inputs" + else + echo "Inputs all up to date" + fi + + - name: Create pull request + run: | + gh pr create -H main --title "Bot: flake update" --body "Weekly update :3" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}