Skip to content

ci: switch release workflow to PR-based flow#114

Merged
abubnalitic-nbl merged 2 commits into
mainfrom
chore/release-pr-flow
Apr 20, 2026
Merged

ci: switch release workflow to PR-based flow#114
abubnalitic-nbl merged 2 commits into
mainfrom
chore/release-pr-flow

Conversation

@abubnalitic-nbl

@abubnalitic-nbl abubnalitic-nbl commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This adopts a two-workflow PR-based flow that works within the protection rules, with no org-admin or PAT escalation required.

What changes

release.yml (manual dispatch, replaces existing file)

  • Runs semantic-release version --no-commit --no-push --no-tag --no-vcs-release to update pyproject.toml, __init__.py, and CHANGELOG.md in the workflow's workspace only
  • Opens a labeled (release, automated) PR via peter-evans/[email protected], pinned to SHA (5f6978f)
  • Re-dispatching updates the same PR in place (branch: release/next)
  • No-op when there's nothing releasable — skips PR creation if files aren't modified

release-finalize.yml (new, triggers on PR merge)

  • Fires when a PR labeled release merges into main
  • Tags the merge commit with v{version} and publishes a GitHub Release with the CHANGELOG section for that version

Test plan

  • CI passes on this PR
  • After merge, dispatch Release PR workflow → verify a PR for v1.1.0 opens with the expected file changes
  • Merge the v1.1.0 PR → verify release-finalize.yml runs, creates the tag, and publishes the GitHub Release
  • Verify docker-publish.yml fires on the new tag as before (no changes needed there)

🤖 Generated with Claude Code

The previous release workflow pushed the version bump and CHANGELOG directly
to main, which conflicts with the org ruleset requiring all main changes to go
through pull requests (GH006).

This splits the release into two workflows:

- `release.yml` (manual dispatch): runs semantic-release in
  `--no-commit --no-push --no-tag --no-vcs-release` mode to update the version
  files and CHANGELOG in-workspace, then opens a labeled PR via
  `peter-evans/create-pull-request`. Re-dispatching updates the PR in place.

- `release-finalize.yml` (pull_request:closed): when the labeled release PR
  merges into main, creates the git tag at the merge commit and publishes the
  GitHub Release with the extracted CHANGELOG section.

Uses the same `peter-evans/create-pull-request` SHA pin (v8.1.1) that other
netboxlabs repos standardize on. No GitHub App or PAT required — works with
the default `GITHUB_TOKEN`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Remove redundant steps and defaults surfaced in review: drop the
has_changes pre-check (peter-evans handles empty diffs), swap uv sync
for uvx to skip installing project deps, collapse tag + release into a
single gh release create --target, and prune inherited boilerplate
(default tokens, default uv version, redundant cancel-in-progress).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@abubnalitic-nbl abubnalitic-nbl merged commit f805f72 into main Apr 20, 2026
12 checks passed
@abubnalitic-nbl abubnalitic-nbl deleted the chore/release-pr-flow branch April 20, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants