-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add an action to make gomod2nix.toml auto update when go.mod/go…
….sum update (#909) * feat: add an action to make gomod2nix.toml auto update when go.mod/go.sum update * chore: bump deps --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3faabc4
commit a29b116
Showing
2 changed files
with
67 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: gomod2nix auto update | ||
on: | ||
push: | ||
paths: | ||
- 'go.mod' | ||
- 'go.sum' | ||
- '.github/workflows/gomod2nix.yml' | ||
jobs: | ||
gomod2nix: | ||
name: gomod2nix update | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up nix | ||
uses: cachix/install-nix-action@v27 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@master | ||
|
||
- name: gomod2nix update | ||
run: | | ||
nix run github:nix-community/gomod2nix | ||
- name: Commit back | ||
if: ${{ !github.head_ref }} | ||
continue-on-error: true | ||
run: | | ||
git config --local user.name 'github-actions[bot]' | ||
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git add --all | ||
git commit -m "chore: bump deps" | ||
- name: Create Pull Request | ||
if: ${{ !github.head_ref }} | ||
continue-on-error: true | ||
uses: peter-evans/create-pull-request@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters