@@ -3,7 +3,7 @@ name: Update flake inputs
33on :
44 workflow_dispatch :
55 schedule :
6- - cron : " 0 6 * * 1 "
6+ - cron : " 0 1 * * * "
77
88permissions :
99 contents : write
9393 fi
9494
9595 - name : Create pull request
96+ id : cpr
9697 if : steps.check.outputs.modified == 'true'
9798 uses : peter-evans/create-pull-request@v8
9899 with :
@@ -103,6 +104,43 @@ jobs:
103104 add-paths : |
104105 flake.lock
105106 Linux/NixOS/flake.lock
106- title : " Update flake locks"
107+ title : " chore(nix): update flake locks"
107108 body : |
109+ ## What
110+
108111 Updates root and NixOS flake locks after scheduled input refresh.
112+
113+ ## Why
114+
115+ Keeps pinned flake inputs current while preserving review through a pull request.
116+
117+ ## Testing
118+
119+ - `nix flake check --no-build`
120+ - `nix build --no-link --print-build-logs .#checks.x86_64-linux.shells-module`
121+ - `nix build .#mysetup --print-build-logs`
122+ - `./result/bin/mysetup --help`
123+ - `nix build --no-link --print-build-logs '.#nixosConfigurations.NixOS.config.home-manager.users.user.xdg.configFile."hypr/end4".source'`
124+ - `nix build --no-link --print-build-logs '.#nixosConfigurations.NixOS.config.home-manager.users.user.programs.caelestia.package'`
125+ - `nix build .#mysetup --print-build-logs`
126+ - `./result/bin/mysetup --help`
127+
128+ - name : Approve pull request
129+ continue-on-error : true
130+ if : steps.cpr.outputs.pull-request-number != ''
131+ env :
132+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
133+ PR_NUMBER : ${{ steps.cpr.outputs.pull-request-number }}
134+ run : |
135+ gh pr review "$PR_NUMBER" --approve --body "Auto-approved after scheduled flake update checks passed."
136+
137+ - name : Merge pull request
138+ if : steps.cpr.outputs.pull-request-number != ''
139+ env :
140+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
141+ PR_NUMBER : ${{ steps.cpr.outputs.pull-request-number }}
142+ run : |
143+ if gh pr merge "$PR_NUMBER" --squash --delete-branch; then
144+ exit 0
145+ fi
146+ gh pr merge "$PR_NUMBER" --auto --squash --delete-branch
0 commit comments