ci: add auto changelog and version update workflows#50
Conversation
yCodeTech
left a comment
There was a problem hiding this comment.
Looks ok. But one problem with the original code in auto comment blocks repo is that when you have a title like "feat: added..." or "feat: add..." then it'll get changed to duplicated words for the changelog like "Added added..." or "Added add..."
When a PR title like "feat: add X" or "fix: fixed Y" was processed, the changelog entry would duplicate the verb: "Added add X" / "Fixed fixed Y". A new `stripRedundantLeadingWord` helper removes the leading verb from the cleaned title when it is a form of the prefix already applied to the entry (e.g. add/adds/added/adding when prefix is "Added"). If stripping would leave the title empty or whitespace-only, the original is kept.
Fixed in the latest commits. A |
Ports the automated changelog and version-bump pipeline from
auto-comment-blocksto valet-windows, adapted for a PHP/Composer project.Workflows
changelog-ci.yml— On PR merge, maps the conventional commit type in the PR title to a changelog section (feat→Added,fix→Fixed, etc.) and appends an entry under## [Unreleased]inCHANGELOG.md. Opens (or updates) adocs: Update changelogPR. Skips PRs labelledskip-changelog,release,auto version bump,dependencies, or typedchore/ci/docs/test/etc.release.yml— On GitHub release (pre/full): validates semver tag, bumps version incli/version.phpviased, renames## [Unreleased]to a versioned heading (## [3.5.0](.../tree/v3.5.0) - YYYY-MM-DD), opens a release PR with auto-merge, waits for merge, then moves the tag to the merge commit.setup-labels.yml— Syncs global + local labels on dispatch or file change.Scripts (invoked via
actions/github-script)update-changelog.mjs— Parses PR title, builds and inserts the changelog entry; handles duplicate detection and[Unreleased]section creation.check-changelog-exclusions.mjs— Gates the changelog update by inspecting PR labels and commit type before any file is touched.Config
.github/config/labels.json— Definesskip-changelogandauto version bumplabels required by the workflows.Adaptations from
auto-comment-blocksauto-comment-blockspackage.jsonvianpm versioncli/version.phpviased.../releases/tag/vX.Y.Z.../tree/vX.Y.Z(matches existing CHANGELOG style)[Unreleased]heading## [Unreleased]## [Unreleased](url)variant already in the filehttps://github.com${{ github.server_url }}