🌱 Add CI to check if golang version updated #1
Workflow file for this run
This file contains hidden or 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
on: | ||
pull_request: | ||
paths: | ||
- 'go.mod' | ||
branches: | ||
- 'main' | ||
jobs: | ||
go-verdiff: | ||
runs-on: ubuntu-latest | ||
name: Verify golang version changes | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
Check failure on line 13 in .github/workflows/go-verdiff.yaml
|
||
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | ||
- name: Get changed files | ||
id: changed-files | ||
run: | | ||
old=$(git grep -ohP '^go .*$' main -- go.mod) | ||
new=$(git grep -ohP '^go .*$' go.mod) | ||
if [ ${new} != ${old} ]; then | ||
echo "New version of golang found: ${new} vs ${old}" | ||
exit 1 | ||
fi |