Skip to content

Commit 6dcc631

Browse files
committed
CI: add go mod tidy workflow
Fixes tailscale#4567 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 parent 78dbb59 commit 6dcc631

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/go_mod_tidy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: go mod tidy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v3
27+
with:
28+
go-version-file: go.mod
29+
30+
- name: check 'go mod tidy' is clean
31+
run: |
32+
go mod tidy
33+
echo
34+
echo
35+
git diff --name-only --exit-code || (echo "Please run 'go mod tidy'."; exit 1)

0 commit comments

Comments
 (0)