-
-
Notifications
You must be signed in to change notification settings - Fork 66
38 lines (32 loc) · 1.02 KB
/
update-flake.yml
File metadata and controls
38 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Update flake.lock
on:
push:
branches: [master]
paths: [go.sum]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- name: Update flake.lock
run: nix flake update
- name: Create Pull Request
env:
GH_TOKEN: ${{ github.token }}
run: |
git diff --quiet flake.lock && exit 0
BRANCH="chore/update-flake-lock"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add flake.lock
git commit -m "chore: update flake.lock"
git push -f origin "$BRANCH"
if ! gh pr list --head "$BRANCH" --state open | grep -q .; then
gh pr create --title "chore: update flake.lock" --body "Automated flake.lock update." --base master
fi