forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.06 KB
/
pr-go-workspace-check.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
41
42
43
44
name: "Go Workspace Check"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- .github/workflows/pr-go-workspace-check.yml
- go.mod
- go.sum
- go.work
- go.work.sum
- '**/go.mod'
- '**/go.sum'
- '**.go'
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: Update workspace
run: make update-workspace
- name: Check for go mod & workspace changes
run: |
if ! git diff --exit-code --quiet; then
echo "Changes detected:"
git diff
echo "Please run 'make update-workspace' and commit the changes."
echo "If there is a change in enterprise dependencies, please update pkg/extensions/main.go."
exit 1
fi
- name: Ensure Dockerfile contains submodule COPY commands
run: ./scripts/go-workspace/validate-dockerfile.sh