ci(DCP-2583): automated release process on skip-release tag#414
ci(DCP-2583): automated release process on skip-release tag#414
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR adds an automated release flow driven by PR title tagging ([run-release]), including CI gates to prevent malformed release triggers and a Go-based changelog version extractor used by the release automation.
Changes:
- Added GitHub Actions workflows to validate release-tag spelling/casing and require
CHANGELOG.mdupdates when[run-release]is present. - Added an automated “create tag + GitHub release + build artifacts” workflow on merge to
mainfor[run-release]PRs. - Extended
scripts/changelogwith anextract-versioncommand plus unit tests to reliably extract the next release version fromCHANGELOG.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/changelog/main.go |
Adds extract-version command and strict semver extraction helper used by release automation. |
scripts/changelog/main_test.go |
Adds unit tests for strict release-version extraction edge cases. |
.github/workflows/release.yml |
Makes release build workflow reusable via workflow_call and checks out the requested tag. |
.github/workflows/create-release.yml |
Creates tag + GitHub release on merged [run-release] PRs and triggers the build workflow. |
.github/workflows/changelog-gate.yml |
Gates [run-release] PRs to ensure CHANGELOG.md is modified. |
.github/workflows/release-tag-gate.yml |
Validates [run-release] tag spelling/casing in PR titles and rejects common mistakes. |
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] |
There was a problem hiding this comment.
Is this going to try and create the release if someone opened a PR but then decided not to go ahead with the change and closed the PR in the UI?
There was a problem hiding this comment.
ohh well spotted boss 🌟 I had Claude double check this, and it's safe because our finalize-release job is gated on:
github.event.pull_request.merged == true &&
contains(github.event.pull_request.title, '[run-release]')
So if someone closes without merging, merged is false, that job is skipped, and no tag / release / build-release runs. You may still see a workflow run in the Actions tab with the job skipped — that’s expected.
There was a problem hiding this comment.
Excellent, sorry I missed that 🙏
This pull request implements a robust, automated workflow for managing releases via GitHub Actions, ensuring consistency and correctness in changelog and release processes. The main changes introduce new workflow files for release gating, automate release creation, and extend the
changelogscript with version extraction logic and tests.Release automation and gating:
.github/workflows/changelog-gate.ymlto require that any PR with[run-release]in the title must include aCHANGELOG.mdupdate, preventing accidental releases without changelog entries..github/workflows/release-tag-gate.ymlto validate that PR titles use the exact[run-release]tag (case and spelling), catching common mistakes and preventing mis-triggered releases..github/workflows/create-release.ymlto automate release creation: when a[run-release]PR is merged tomain, it extracts the version fromCHANGELOG.md, creates a tag, generates release notes, and triggers the build workflow.Release build workflow enhancements:
.github/workflows/release.ymlto accept a release tag as input, check out the correct tag, and use it for building and uploading artifacts, enabling both manual and automated (workflow_call) releases. [1] [2]Changelog tooling improvements:
scripts/changelog/main.gowith a newextract-versioncommand andExtractReleaseVersionfunction to reliably extract the first strict semver version fromCHANGELOG.md, skipping "next" and non-semver headings. [1] [2] [3] [4] [5]ExtractReleaseVersioninscripts/changelog/main_test.go, covering edge cases like missing sections, pre-releases, and malformed headings.Fixes #358