Chore: Add github action to check go module updates (#84936)

This commit is contained in:
Todd Treece 2024-03-25 18:47:34 -04:00 committed by GitHub
parent 154868e624
commit d4e6b325bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 0 deletions

1
.github/CODEOWNERS vendored
View File

@ -694,6 +694,7 @@ embed.go @grafana/grafana-as-code
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
/.github/workflows/feature-toggle-cleanup.yml @tolzhabayev
/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.js @tolzhabayev
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
# Generated files not requiring owner approval
/packages/grafana-data/src/types/featureToggles.gen.ts @grafanabot

View File

@ -0,0 +1,47 @@
name: "Go Workspace Check"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- '**/go.work'
- '**/go.work.sum'
- '**/go.mod'
- '**/go.sum'
jobs:
check:
name: Go Workspace Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set go version
uses: actions/setup-go@v4
with:
go-version: '1.21.8'
- name: Workspace Sync
run: go work sync
- name: Check for go mod & workspace changes
run: |
if ! git diff --exit-code --quiet; then
echo "Changes detected. Please run 'go work sync' and commit the changes."
exit 1
fi
- name: Build
run: make build-go
- name: Check for go workspace changes
run: |
if ! git diff --exit-code --quiet; then
echo "Changes detected. Please run 'make build-go' and commit the changes."
exit 1
fi