-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actions: automatic nix flake updates
- Loading branch information
1 parent
58cb76e
commit 84e4b26
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# https://xyven.dev/articles/automatic-flake-updates-with-garnix | ||
name: "update" | ||
|
||
on: | ||
workflow_dispatch: # allows manual triggering | ||
schedule: # run the job at 04:00 every 3 days | ||
- cron: '0 4 */3 * *' | ||
|
||
jobs: | ||
update: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
with: | ||
# We set our custom GitHub token for any private flake inputs we might have | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
- name: Update flake.lock | ||
uses: DeterminateSystems/update-flake-lock@main | ||
id: update | ||
with: | ||
commit-msg: "flake: update" | ||
pr-title: "flake: update" | ||
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} | ||
- run: | | ||
if [ -n "${{ steps.update.outputs.pull-request-number }}" ]; then | ||
gh pr merge --auto --rebase ${{ steps.update.outputs.pull-request-number }} | ||
fi | ||
env: | ||
GH_TOKEN: ${{ github.token }} |