Skip to content

Commit f9b6f36

Browse files
water-sucksoschwartz10612
authored andcommitted
ci: update nix go vendor hash if needed for dependabot PRs
1 parent 0e96176 commit f9b6f36

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Update Nix Package Hash On Dependabot PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches:
7+
- main
8+
9+
jobs:
10+
nix-update:
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.head_ref }}
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Install Nix
25+
uses: DeterminateSystems/nix-installer-action@main
26+
27+
- name: Run nix-update
28+
run: |
29+
nix run nixpkgs#nix-update -- --flake pangolin-newt --no-src --version skip
30+
31+
- name: Check for changes
32+
id: changes
33+
run: |
34+
if git diff --quiet; then
35+
echo "changed=false" >> "$GITHUB_OUTPUT"
36+
else
37+
echo "changed=true" >> "$GITHUB_OUTPUT"
38+
fi
39+
40+
- name: Commit and push changes
41+
if: steps.changes.outputs.changed == 'true'
42+
run: |
43+
git config user.name "dependabot[bot]"
44+
git config user.email "dependabot[bot]@users.noreply.github.com"
45+
46+
git add .
47+
git commit -m "chore(nix): fix hash for updated go dependencies"
48+
git push

0 commit comments

Comments
 (0)