Skip to content

Commit 716e964

Browse files
committed
Add CI to check if golang version updated
Signed-off-by: Todd Short <[email protected]>
1 parent d1adabd commit 716e964

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/go-verdiff.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: go-verdiff
2+
on:
3+
pull_request:
4+
paths:
5+
- go.mod
6+
branches:
7+
- main
8+
jobs:
9+
go-verdiff:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Check golang version
16+
run: |
17+
old=$(git grep -ohP '^go .*$' ${{ github.event.pull_request.base.sha }} -- go.mod)
18+
new=$(git grep -ohP '^go .*$' go.mod)
19+
if [ "${new}" != "${old}" ]; then
20+
echo "New version of golang found: \"${new}\" vs \"${old}\""
21+
exit 1
22+
else
23+
echo "No golang version change detected"
24+
fi

0 commit comments

Comments
 (0)