fix: update release workflow to respect branch protection#1218
Merged
markussiebert merged 5 commits intomainfrom Jan 12, 2026
Merged
fix: update release workflow to respect branch protection#1218markussiebert merged 5 commits intomainfrom
markussiebert merged 5 commits intomainfrom
Conversation
- modify create-release workflow to create PR instead of direct push - add tag-on-merge workflow to create tags when release PRs are merged - ensures release process works with branch protection rules
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the release workflow to work with branch protection rules by moving from a direct push model to a pull request model. Instead of pushing directly to main, the create-release workflow now creates a release branch and PR, and a new tag-on-merge workflow handles tag creation and release publishing when the PR is merged.
Changes:
- Modified create-release workflow to create a PR instead of direct push to main
- Added new tag-on-merge workflow to create tags and trigger releases when release PRs merge
- Added pull-requests: write permission to create-release workflow
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/create-release.yml | Modified to create release branch and PR instead of direct push; added PR creation logic |
| .github/workflows/tag-on-merge.yml | New workflow that triggers on PR merge to create tags, releases, and trigger release workflow |
Comments suppressed due to low confidence (1)
.github/workflows/create-release.yml:96
- These steps (Create GitHub Release and Trigger release workflow) should be removed from this workflow. They are attempting to create a release and trigger the release workflow before the PR is merged, but the tag doesn't exist yet at this point. The tag will only be created when the PR is merged by the tag-on-merge workflow. This logic belongs in the tag-on-merge.yml workflow, where it's already implemented (lines 45-57 of that file). Creating the release here will result in duplicate releases being created.
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create GitHub release using the changelog content
gh release create ${{ steps.version.outputs.new_tag }} \
--title "${{ steps.version.outputs.new_tag }}" \
--notes-file /tmp/release_notes.md
- name: Trigger release workflow on tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Manually trigger the 'release' workflow on the new tag ref
# Using workflow_dispatch with ref to run on the tag
gh workflow run release.yml --ref ${{ steps.version.outputs.new_tag }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Updates the release workflow to work with branch protection rules:
This fixes the issue where the create-release workflow was failing due to protected branch restrictions.