-
Notifications
You must be signed in to change notification settings - Fork 38
31 lines (29 loc) · 1.2 KB
/
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
name: Update gomod2nix.toml
on: pull_request
permissions:
contents: write
jobs:
renovatebot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'renovate[bot]' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Update gomod2nix.toml
run: |
nix develop .#renovate --command bash -c "gomod2nix:update"
# git push if we have a diff
if [[ -n $(git diff) ]]; then
git add nix/packages/treefmt/gomod2nix.toml
git config --global user.email "<29139614+renovate[bot]@users.noreply.github.com>"
git config --global user.name "renovate[bot]"
git commit -m "chore: update gomod2nix.toml"
git push origin HEAD:${{ github.head_ref }}
fi