-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (72 loc) · 2.82 KB
/
pr-workflow.yaml
File metadata and controls
78 lines (72 loc) · 2.82 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Pull Request
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
contents: read
pull-requests: write
id-token: write
jobs:
linting:
name: Linting & checking uncommitted changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
- name: Setup access for private go modules
run: |
git config --global url.'https://${{ secrets.GH_REPO_READ_TOKEN }}@github.com'.insteadOf 'https://github.com'
- name: Install buf plugins
run: make buf/plugins
- uses: bufbuild/buf-action@fd21066df7214747548607aaa45548ba2b9bc1ff # v1.4.0
with:
# Don't push the schema to the Buf Schema Registry
push: false
# Optional GitHub token for API requests. Ensures requests aren't rate limited.
github_token: ${{ secrets.GITHUB_TOKEN }}
# make sure the PR includes the updated generated code.
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: "Generate code"
run: make generate
- name: "Compile Go files"
run: make build-go
- name: "Check uncommited changes"
uses: CatChen/check-git-status-action@cc5a79733c441f67cd0cd076de116cd2eebcebfe # v2.1.3
with:
fail-if-not-clean: true
request-changes-if-not-clean: true
request-changes-comment: |
It looks like the PR doesn't include updates for the generated code.
Please make sure you've run the following commands from the root directory:
```shell
make generate
```
Once you've added them, you can dismiss this review.
publish-packages:
name: Publish PR Packages
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
permissions:
pull-requests: write
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
- name: Publish packages
id: publish
uses: ./.github/actions/publish-packages
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
version_source: ${{ github.ref }}
pr_number: ${{ github.event.pull_request.number }}
pr_sha: ${{ github.event.pull_request.head.sha }}