ci(release): Auto-release when proto schemas change on main#260
Merged
Conversation
Trigger the release workflow on pushes to main so merged PRs automatically create the next version with craft. Keep manual dispatch support and skip release-triggered release commits to avoid recursive runs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
Only trigger push-based releases when changes land under proto/. This keeps version bumps aligned with schema updates while preserving manual release runs. Co-authored-by: Cursor <cursoragent@cursor.com>
armenzg
commented
May 14, 2026
| on: | ||
| push: | ||
| branches: | ||
| - main |
Member
Author
There was a problem hiding this comment.
Execute on pushes on main besides when dispatched via the workflow.
| branches: | ||
| - main | ||
| paths: | ||
| - 'proto/**' |
Member
Author
There was a problem hiding this comment.
We will only do releases if changes happen under proto/
| name: 'Release a new version' | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| !startsWith(github.event.head_commit.message, 'release:') |
Member
Author
There was a problem hiding this comment.
These lines are a job-level guard that decides whether the release job should run:
-
github.event_name == 'workflow_dispatch'- If someone manually triggers the workflow from Actions UI, always run.
-
||- Logical OR.
-
!startsWith(github.event.head_commit.message, 'release:')- For push-triggered runs, skip the job when the latest commit message starts with
release:.
- For push-triggered runs, skip the job when the latest commit message starts with
Why this exists:
- Your automated release flow creates commits like
release: x.y.z. - Those commits also land on
mainand would retrigger the workflow. - This check prevents that self-triggering loop.
So in practice: manual runs always execute; push runs execute unless they are release-generated commits.
| version: ${{ github.event.inputs.version }} | ||
| force: ${{ github.event.inputs.force }} | ||
| version: ${{ github.event.inputs.version || 'auto' }} | ||
| force: ${{ github.event.inputs.force || 'false' }} |
Member
Author
There was a problem hiding this comment.
Default to these values if not defined.
armenzg
commented
May 14, 2026
| push: | ||
| branches: | ||
| - main | ||
| paths: |
4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automate releases on merges to
mainwhen the merge includes protobuf schema changes underproto/**, so version bumps and package publishing stay aligned with schema updates.Scoped auto-release trigger
The
releaseworkflow now runs onpushtomainwith apathsfilter forproto/**, and usesversion=autoby default for push-triggered runs.Manual override and loop prevention
Manual
workflow_dispatchremains available for explicitversion/forceinputs, and release-generatedrelease:commits are ignored to prevent recursive runs.README now documents the new trigger scope and the manual dispatch path.