From fcb853e36a0dc88d6bba27010a29e5046265cf62 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Mon, 25 May 2026 16:52:15 +0200 Subject: [PATCH] CI: add weeklyUpdate workflow Assissted-by: ChatGPT 5.5 --- .github/workflows/weeklyUpdate.yml | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/weeklyUpdate.yml diff --git a/.github/workflows/weeklyUpdate.yml b/.github/workflows/weeklyUpdate.yml new file mode 100644 index 0000000..94e449b --- /dev/null +++ b/.github/workflows/weeklyUpdate.yml @@ -0,0 +1,58 @@ +name: Weekly Flake Update + +on: + schedule: + - cron: "0 3 * * 1" # every Monday at 03:00 UTC + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + flake_update: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: DeterminateSystems/nix-installer-action@v12 + + - name: Set branch name (date) + id: vars + run: | + echo "branch=flake-update/$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT + + - name: Create update branch + run: | + git checkout -B ${{ steps.vars.outputs.branch }} + + - name: Update flake inputs + run: | + nix flake update + + - name: Commit changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add flake.lock + git commit -m "chore: weekly flake update" || echo "No changes to commit" + + - name: Push branch + run: | + git push origin ${{ steps.vars.outputs.branch }} --force + + - name: Install GitHub CLI + run: | + sudo apt-get update + sudo apt-get install -y gh + + - name: Create Pull Request + run: | + gh pr create \ + --base main \ + --head ${{ steps.vars.outputs.branch }} \ + --title "[Automated] Weekly flake update $(date +%Y-%m-%d)" \ + --body "Automated weekly update of flake inputs for $(date +%Y-%m-%d)." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}