-
-
Notifications
You must be signed in to change notification settings - Fork 196
34 lines (30 loc) · 984 Bytes
/
update-gomod2nix.yml
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
name: Update gomod2nix.toml
on:
push:
paths:
- 'src/go.mod'
- 'src/go.sum'
permissions:
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Update checksum
run: |
cd src
nix develop --extra-experimental-features "nix-command flakes" '.#' -c "gomod2nix"
# git push if we have a diff
if [[ -n $(git diff) ]]; then
git config --global user.email "[email protected]"
git config --global user.name "MHNightCat"
git commit -am "chore: update gomod2nix"
BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's/refs\/heads\///g')
git push origin HEAD:$BRANCH_NAME
fi