ci: use pull requests for releases to satisfy branch protection#18
Conversation
|
@copilot rebase and delete issues/1.md |
There was a problem hiding this comment.
Pull request overview
Updates the release automation to avoid direct pushes to main (blocked by branch protection) by switching to a “release branch + PR” flow driven by GitHub Actions and semantic-release.
Changes:
- Adjusts semantic-release configuration to run on
release-*branches and disables@semantic-release/gitpushing. - Updates the release workflow to create a timestamped release branch, run semantic-release, push the branch, and open a PR.
- Adds
@semantic-release/execto devDependencies and updates lockfile.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/release.yaml |
Creates/pushes a release branch and opens a PR instead of pushing to main. |
package.json |
Updates semantic-release branch config and disables git plugin pushing; adds exec dependency. |
package-lock.json |
Lockfile update for new dependency and version metadata changes. |
issues/1.md |
Minor formatting fix in the issue documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "@commitlint/config-conventional": "^20.3.1", | ||
| "@semantic-release/changelog": "^6.0.3", | ||
| "@semantic-release/commit-analyzer": "^13.0.1", | ||
| "@semantic-release/exec": "^7.1.0", |
There was a problem hiding this comment.
@semantic-release/exec is added as a dependency but isn’t configured/used in the semantic-release plugin chain. Either add it to the release.plugins configuration (if needed) or remove the dependency to avoid extra maintenance and supply-chain surface area.
| "@semantic-release/exec": "^7.1.0", |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcb5dd907a8 # v5.0.0 |
There was a problem hiding this comment.
The pinned commit SHA for actions/checkout differs from the v5.0.0 SHA used elsewhere in the repo (e.g., .github/workflows/go.yml). This looks like a typo and may either break the workflow (unknown ref) or unintentionally change the action version; update it to the same verified v5.0.0 digest used in other workflows.
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcb5dd907a8 # v5.0.0 | |
| - uses: actions/checkout@cd9c8d25c5e1b2e1e82d79fc8895cf6c8f5b1c6d # v5.0.0 |
| persist-credentials: true | ||
| fetch-tags: true | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.WRITE_GH_TOKEN }} |
There was a problem hiding this comment.
This workflow requires a custom secret (WRITE_GH_TOKEN) for checkout and for GITHUB_TOKEN, but the repo doesn’t reference this secret anywhere else. If this secret isn’t configured in all environments, the release workflow will fail; prefer using the built-in GITHUB_TOKEN with the needed permissions, or add explicit documentation/validation for the required secret.
| "main", | ||
| { | ||
| "name": "release-*", | ||
| "prerelease": false | ||
| } |
There was a problem hiding this comment.
Allowing semantic-release to run on release-* means it will perform an actual release from that PR branch (including tagging and running @semantic-release/github), which undermines the goal of only releasing after the PR is merged and checks pass. Consider limiting releases to main and using a PR-oriented flow (e.g., dry-run + prepare-only changes, or semantic-release-pr) for release-* branches.
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Update semantic-release configuration to create release PRs instead of pushing directly to main, preventing branch protection rule violations. - Add @semantic-release/exec dependency - Configure semantic-release to work on release-* branches - Set push: false in @semantic-release/git to prevent direct pushes - Update workflow to create release branch and PR - Add pull-requests: write permission to workflow Fixes branch protection rule violations during release process. Signed-off-by: Claude 3.7 Sonnet via Cline Co-authored-by: Xe <529003+Xe@users.noreply.github.com> Signed-off-by: Xe Iaso <xe@tigrisdata.com>
- Remove non-existent semantic-release-dry-run script reference - Fix git diff comparison to use origin/main instead of HEAD~1 Signed-off-by: Claude 3.7 Sonnet via Cline Co-authored-by: Xe <529003+Xe@users.noreply.github.com> Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Removed the issues/1.md file as requested. Signed-off-by: Claude 3.7 Sonnet via Cline Co-authored-by: Xe <529003+Xe@users.noreply.github.com> Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xe Iaso <me@xeiaso.net> Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <me@xeiaso.net> Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
b7fa2e2 to
ecb5158
Compare
|
🎉 This PR is included in version 0.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
mainDetails
Semantic-release configuration changes:
release-*branch pattern to allowed branches for semantic-release executionpush: falsein@semantic-release/gitto prevent direct main pushes@semantic-release/execdependency (v7.1.0)Workflow changes (
.github/workflows/release.yaml):release-1737915120)gh pr createpull-requests: writepermissionCleanup:
issues/1.mdfileFlow:
The PR will go through all required status checks before merge. GitHub release creation still happens automatically via
@semantic-release/githubafter merge.Test plan
go build ./...npm run formatOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.