feat(CI): suppress generated files in PR diffs #14
Workflow file for this run
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
name: 'Generate' | |
on: | |
# push: | |
# branches: | |
# - main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
generate: | |
runs-on: ubuntu-22.04 | |
permissions: | |
checks: write | |
contents: read | |
pull-requests: read | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 | |
with: | |
go-version: '1.21.8' | |
- run: | | |
echo "Installing dependencies and regenerating code & docs from .proto definitions" | |
echo "Installing buf..." | |
GO111MODULE=on go install github.com/bufbuild/buf/cmd/buf@v1.30.0 | |
echo "Installing golangci-lint..." | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55 | |
echo "Installing protoc-gen-doc..." | |
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1 | |
echo "Dependencies installed. Running code & docs generation..." | |
make proto-generate | |
echo "Code & docs generation complete. " | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
git commit -m "CI: Regenerate code & docs from .proto definitions." | |
git push origin $BRANCH_NAME | |
echo "Wrapping up 'generate' job." |