Skip to content

Commit

Permalink
feat(ci): automerge for automatic flake update PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenhoenle committed Aug 31, 2024
1 parent f8dd39b commit de2815b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize, reopened]
push:
branches: [main]
workflow_dispatch:

jobs:
lints:
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/flake-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,35 @@ name: update flake lock
on:
workflow_dispatch:
schedule:
- cron: '0 23 * * *'
- cron: '0 2 * * *'

jobs:
lockfile:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v13
- uses: DeterminateSystems/update-flake-lock@v23
- name: Checkout
uses: actions/checkout@v4

- name: Install nix
uses: DeterminateSystems/nix-installer-action@v13

- name: Update flake lock
uses: DeterminateSystems/update-flake-lock@v23
id: update-flake-lock
with:
git-author-name: 'github-actions[bot]'
git-author-email: 'github-actions[bot]@users.noreply.github.com'
git-committer-name: 'github-actions[bot]'
git-committer-email: 'github-actions[bot]@users.noreply.github.com'
env:
GIT_COMMIT_MESSAGE: "chore(nixos): flake update"

- name: Nix flake check
if: ${{ steps.update-flake-lock.outputs.pull-request-operation == 'created' }}
run: gh workflow run build.yaml --ref update_flake_lock_action

- name: Automerge
if: ${{ steps.update-flake-lock.outputs.pull-request-operation == 'created' }}
run: "gh pr merge --auto --merge ${{ steps.update.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit de2815b

Please sign in to comment.