-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make generated proto files be committed from CI (#5982)
* Try committing result * fix indent * fix cmd * try-token * Tryfix * try again * Try again * try docs suggested method * try simpler thing * ah wrong perms at top * try agian * Try actions/checkout#317 * try actions/checkout#719 * Generated protofile changes * Try again * Generated protofile changes * use proper paths filtering * Make it do make proto-all * Rename workflow, add go.sum to diff list --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: devbot-wizard <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# Verify that generated code is up-to-date. | ||
# | ||
# Note that we run these checks regardless whether the input files have | ||
# changed, because generated code can change in response to toolchain updates | ||
# even if no files in the repository are modified. | ||
name: Check generated code | ||
# Ensure that generated code is up-to-date. | ||
name: Generate protobuf code | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- '*' | ||
paths: | ||
- 'proto/**' | ||
- '**/**.proto' | ||
- '**/**.pb.go' | ||
- '**/**.sum' | ||
- '**/client/**.go' | ||
- 'scripts/ci/**' | ||
- 'Makefile' | ||
- 'Dockerfile' | ||
- '.github/workflows/check-generated.yml' | ||
|
||
permissions: | ||
contents: read | ||
contents: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -25,24 +29,18 @@ jobs: | |
- | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 # we need a .git directory to run git diff | ||
- | ||
name: Get git diff | ||
uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
proto/** | ||
**/**.pb.go | ||
**/client/**.go | ||
scripts/ci/** | ||
Makefile | ||
Dockerfile | ||
.github/workflows/check-generated.yml | ||
- | ||
name: 🐿 Setup Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.20' | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- | ||
name: "Check protobuf generated code" | ||
run: scripts/ci/check-generated.sh | ||
run: | | ||
make proto-all | ||
make run-querygen | ||
- | ||
name: Commit changes | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add *.go | ||
git add *.proto | ||
git commit -m "Generated protofile changes" || echo "No changes to commit" | ||
git push |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.