Repository navigation
release: v3.3.0 - add compute-highest-commit-type foundation action (v4… - #19
Merged
Merged
Conversation
Shinrai
force-pushed
the
feat/v4-foundation-actions
branch
from
May 21, 2026 21:40
8f10c09 to
af2a16e
Compare
Shinrai
force-pushed
the
feat/v4-foundation-actions
branch
from
May 21, 2026 21:44
0146ce6 to
2b5e2ac
Compare
…§11 PR 1) Pure-logic action: parse a JSON array of conventional commits and emit the highest-priority type plus implied semver bump. Composite action that runs a single Node step against action.mjs. Action.mjs exports parseCommit/computeHighest/bumpFor/TYPE_PRIORITY so the sibling test.mjs can exercise the pure logic without spinning up an Actions runner. 30 test assertions cover: - subject parsing (plain / scoped / breaking-mark / breaking-footer) - bump derivation per type - priority ranking (feat > fix > perf > ... > chore > unknown) - edge cases (empty list, all non-conventional, unknown types) Run: `cd .github/actions/git/steps/compute-highest-commit-type && node test.mjs` Not wired into any workflow yet; consumed in subsequent PRs by normalize-pr-title (§6.4) and check-release-commit refactor.
Composite action implementing §6.4 of the v4 design. Skips bot-authored
PRs, the long-running release PRs (next/hotfix → master), and titles
starting with 'release:' (the v3 escape-hatch carries forward).
action.mjs imports compute-highest-commit-type's pure logic
(parseCommit / TYPE_PRIORITY / computeHighest) so it doesn't
re-implement the parser. Exports the pure logic for test.mjs:
- extractTitleParts: regex parse of a current title
- shouldSkip: pre-API skip decision
- titleConforms: 'title is acceptable given required type+breaking'
- buildNewTitle: type/scope/breaking/summary → new title
- summaryFromSubject: strip conventional prefix to get bare summary
- findRepresentativeCommit: pick chronologically-oldest matching commit
using findLast (matches the v3.2.x title-suffix logic)
Side-effecting main() does: fetch PR + commits → compute highest →
gate via shouldSkip/titleConforms → PATCH title → sentinel-deduped
comment via COMMENT_SENTINEL.
Not wired into any workflow yet; consumed by local-pr-title-normalizer.yml
in a later PR.
Implements §6.5 of the v4 design. When a contributor opens a PR with a
head branch matching ^(hotfix|security)/, retarget its base from the
default ('next' under v4) to 'hotfix'. Idempotent — skips bot-created
PRs, non-matching head refs, and PRs already on the target base.
action.mjs exports the pure logic for test.mjs:
- compilePattern: regex source → RegExp (with default fallback)
- shouldSkip: gating decision combining user-type, head-match,
base-already-target
- buildCommentBody: explanatory comment template using the sentinel
Sentinel COMMENT_SENTINEL = '_Auto-redirected PR base:_' (different
from normalize-pr-title's sentinel so the two actions can both post
to the same PR without interfering).
Side-effecting main(): fetch PR (fill missing refs/user-type) →
gate → PATCH base → sentinel-deduped comment.
Not wired into any workflow yet.
Implements §6.3 / §7 of the v4 design — force-push a source ref onto a
target branch via 'git push --force-with-lease' with bounded retry on
lease failure. Used by local-next-reset.yml and local-hotfix-reset.yml
to bring next/hotfix back to master HEAD after a release lands.
action.mjs exports pure helpers for test.mjs:
- buildPushArgs: { remote, sourceRef, targetBranch } → argv
- isLeaseFailure: stderr classifier — matches 'stale info',
'rejected.*force-with-lease', 'fetch first' but NOT auth / missing
repo errors (those should propagate, not retry)
- parseLsRemoteSha: 'git ls-remote' line → SHA for a given ref
Side-effecting main():
1. git push --force-with-lease master:refs/heads/<target>
2. On lease failure, fetch + retry up to max-retries times
3. Confirm via ls-remote, emit reset-sha + retries-used outputs
Not wired into any workflow yet.
… PR 1)
Implements §7.2 of the v4 design — API-driven merge of master into a
target branch via POST /repos/{owner}/{repo}/merges. Used after a
hotfix lands on master to bring next's feature work back in sync
without losing the accumulated work that a force-reset would discard.
action.mjs exports pure helpers for test.mjs:
- buildMergePayload: { targetBranch, sourceRef, commitMessage } →
Merges API body. Falls back to a sensible default message when
commit-message is empty / whitespace.
- interpretMergeResponse: classify response into
{ performed, sha, conflict, error }. Handles 201/204/409 and any
other status as an error with the original status preserved.
Side-effecting main() does a raw fetch (not the shared api() helper)
because that helper throws on any non-2xx — and 204 'already up-to-
date' is a legitimate success case here, while 409 'merge conflict'
needs a structured failure (sets had-conflict=true output AND exits 1).
Not wired into any workflow yet.
GitHub auto-links a hash followed by a number (in commit messages,
PR/issue bodies, and comments) to the issue/PR with that number. The
design doc used 'PR #N'-style references for the §11 migration sequence
plus one observed-bug reference, which would create spurious
cross-links. Rewrite them to the hashless form ('PR 1', 'PRs 3 through
5', 'bug 1').
The §11 table already used the bare '| N |' cell format, so only prose
references needed changing. No semantic change.
Shinrai
force-pushed
the
feat/v4-foundation-actions
branch
from
May 21, 2026 22:11
64f28c6 to
6533059
Compare
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.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
🐛 Bug Fixes
No bug fixes
🔧 Other Changes
👥 Contributors