Update Buf CI workflow to include additional paths#5
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
There was a problem hiding this comment.
Pull request overview
This pull request modifies the Buf CI workflow to optimize when it runs by adding a paths filter to the push trigger and removes the conditional push logic for publishing to the Buf Schema Registry (BSR).
Changes:
- Added paths filter to push events to trigger only on changes to proto files, buf configuration files, README, and LICENSE
- Removed the conditional
pushparameter that previously limited BSR publishing to version tags only
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -18,4 +25,3 @@ jobs: | |||
| token: ${{ secrets.BUF_TOKEN }} | |||
| github_token: ${{ secrets.GITHUB_TOKEN }} | |||
There was a problem hiding this comment.
The removal of the push parameter changes the behavior of the buf-action. Previously, it only pushed to the Buf Schema Registry (BSR) on version tags (refs/tags/v*). Now with this parameter removed and push_create_visibility: public still set, the action will push to BSR on every push event that matches the paths filter, not just version tags. This could result in unwanted schema pushes to BSR on every commit to proto files, README, LICENSE, or buf configuration files. Consider either:
- Restoring the conditional push logic if you want to continue pushing only on version tags, or
- Removing the
tokenandpush_create_visibilityparameters if you no longer want to push to BSR at all
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| push: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| - '**.proto' | ||
| - '**/buf.yaml' | ||
| - '**/buf.lock' | ||
| - '**/buf.md' |
There was a problem hiding this comment.
The path pattern '**/buf.md' is included in the paths filter, but there don't appear to be any buf.md files in the repository. Buf uses buf.yaml for configuration and optionally buf.lock for dependencies, but buf.md is not a standard Buf configuration file. This pattern will never match any files. Consider removing this unnecessary pattern unless you plan to add buf.md files in the future.
| - '**/buf.md' |
| paths: | ||
| - '**.proto' | ||
| - '**/buf.yaml' | ||
| - '**/buf.lock' |
There was a problem hiding this comment.
The path pattern '**/buf.lock' is included in the paths filter, but there is no buf.lock file in the repository currently. While buf.lock is a valid Buf configuration file that can be generated when using remote dependencies, it doesn't exist in this repository yet. Consider whether this path should be included or removed based on whether you plan to use remote dependencies that would generate a buf.lock file.
| - '**/buf.lock' |
| - '**/README.md' | ||
| - '**/LICENSE' |
There was a problem hiding this comment.
The paths filter includes '/README.md' and '/LICENSE', which means the workflow will run whenever these documentation files change. However, changes to README or LICENSE files don't affect the protobuf schema validation, linting, or breaking change detection that Buf performs. Running the Buf CI workflow on these file changes provides no value and wastes CI resources. Consider removing these patterns to run the workflow only when files that actually affect the protobuf schema are modified.
| - '**/README.md' | |
| - '**/LICENSE' |
No description provided.