mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 19:54:10 -06:00
d912703634
* Updated file * fix quote character issue in workspace check --------- Co-authored-by: Todd Treece <todd.treece@grafana.com>
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
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
|
|
|
|
- name: Set go version
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- 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:"
|
|
git diff
|
|
echo "Please run 'go work sync' and commit the changes."
|
|
echo "If there is a change in enterprise dependencies, please update pkg/extensions/main.go."
|
|
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:"
|
|
git diff
|
|
echo "Please run 'make build-go' and commit the changes."
|
|
echo "If there is a change in enterprise dependencies, please update pkg/extensions/main.go."
|
|
exit 1
|
|
fi
|