-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (40 loc) · 1015 Bytes
/
mod.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
34
35
36
37
38
39
40
on:
pull_request:
push:
branches:
- main
name: Mod
jobs:
mod:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Check go.mod
run: |
go mod download
go mod tidy
if [ ! -z "$(git status --porcelain go.mod)" ]; then
printf "go.mod has modifications\n"
git diff go.mod
exit 1
fi
if [ ! -z "$(git status --porcelain go.sum)" ]; then
printf "go.sum has modifications\n"
git diff go.sum
exit 1
fi
if [ ! -z "$(git status --porcelain go.work)" ]; then
printf "go.work has modifications\n"
git diff go.work
exit 1
fi
if [ ! -z "$(git status --porcelain go.work.sum)" ]; then
printf "go.work.sum has modifications\n"
git diff go.work.sum
exit 1
fi