Repository navigation
Description
Goal
Create a composite action in radiusred/.github (suggested path .github/actions/commitlint/action.yml) that runs wagoid/commitlint-github-action pinned to an exact version with the org's commitlint.config.mjs shipped inside the action directory, so callers need no local config. Rewrite .github's own .github/workflows/commitlint.yml as the reference thin caller: pull_request trigger, permissions contents: read and pull-requests: read, actions/checkout with fetch-depth 0, then the action, from a job named exactly "Lint commit messages"; delete the root commitlint.config.mjs. The action must be usable from other repos in the org (uses: radiusred/.github/.github/actions/commitlint@main or a tag; decide and record). Document adoption in CONTRIBUTING.md: the caller file to copy, the permissions private repos need, and that the check context must stay "Lint commit messages" because of the org ruleset. Prove it on this PR's own check. Design decision recorded on radiusred/ops#17.
Requirements
M5-R1,M5-R2
Plan
Requirements covered: M5-R1 (the action, private-repo permissions, CONTRIBUTING) and the .github share of M5-R2 (this repo calls it, no local config, the check passes on this PR).
- Composite action at
.github/actions/commitlint/(action.yml,runs.using: composite, no inputs) withcommitlint.config.mjsmoved into that directory from the repo root. It runswagoid/commitlint-github-action@v6.2.1(exact tag) withconfigFilepointing at that config. Finding that shapes the design: wagoid is a Docker action that resolvesconfigFileasresolve(GITHUB_WORKSPACE, input)inside its container, and the runner's_actionsdirectory (wheregithub.action_pathlives) is not mounted into that container, so a path into the action directory would silently fall back to bare config-conventional. The action therefore copies the config from${{ github.action_path }}to$GITHUB_WORKSPACE/.radiusred-commitlint/commitlint.config.mjs, prints it to the job log (visible proof of which config the lint used), passes that workspace-relative path to wagoid, and removes the copy afterwards (if: always()). The action does not check out; the caller does, withfetch-depth: 0, before the step. - Rewrite
.github/workflows/commitlint.ymlas the reference caller:pull_requesttrigger,permissions: contents: read, pull-requests: read,actions/checkout@v4withfetch-depth: 0, then the action, from a job named exactlyLint commit messages. This repo references the action by local path (./.github/actions/commitlint) so a PR here tests its own version of the action; every other repo usesradiusred/.github/.github/actions/commitlint@main. Delete the rootcommitlint.config.mjs. - CONTRIBUTING.md: add the action to the inventory; add an adoption section with the exact caller file to copy, the permissions private repos need (
contents: readfor the checkout,pull-requests: readso the action can list the PR's commits), that the job name must stay exactlyLint commit messagesbecause the org rulesetrequire-lintpins that check context on every public repo's default branch, and that the action does not check out. - Untouched:
reusable-release.yml,reusable-finalize-release.yml,calculate_version.
Tests: the repository has no test framework; the PR's own Lint commit messages check runs through the new action and lints the PR's commits, which is the end-to-end proof M5-R2 asks for. The action's log shows the config it placed and its contents.
Commits (each (#39)): add the action with the config moved into it; switch this repo's workflow to it; document adoption.
Ask-the-human points
None. Whether callers pin @main or a tag is recorded as a Decision comment on this issue rather than raised as a gate: CONTRIBUTING.md already fixes @main for everything this repository exports and the milestone goal is one place to change config and version, which a tag would undo.
Activity
radiusred-cody commentedon Sep 4, 2026
Decision: callers reference the action at
@main—uses: radiusred/.github/.github/actions/commitlint@main— asCONTRIBUTING.mdalready prescribes for the reusable release workflows andcalculate_version..githubitself calls it by local path (./.github/actions/commitlint) so a PR in this repository exercises the version of the action the PR carries.Trade-off: a merge here changes commit linting in every caller at once, so a bad config or a broken wagoid bump lands everywhere in one step; the mitigation is that this repository's own
Lint commit messagescheck runs the action on every PR before it can merge, and a revert is one PR. In exchange the milestone goal holds: the config and the pinnedwagoid/commitlint-github-actionversion change in exactly one place, with no bump PR fanned out to every caller.Rejected: tag pinning (
@v1, or a SHA). It would make each repo carry the version again, so a config or wagoid change needs a PR per caller — the per-repo drift ops#7 exists to remove. Pinning the inner action stays exact (wagoid/commitlint-github-action@v6.2.1, not the floating@v6), which is where the third-party supply-chain risk sits.radiusred-cody commentedon Sep 4, 2026
Started by @radiusred-cody[bot].
ci: add a shared commitlint action carrying the org config (#39)
ci: lint this repository's commits through the shared action (#39)
docs: document adopting the shared commitlint action (#39)
radiusred-cody commentedon Sep 4, 2026
Deviation: the action no longer stages its config at the fixed workspace path
.radiusred-commitlint/named in the plan. It creates a fresh directory withmktemp -d "${GITHUB_WORKSPACE}/.radiusred-commitlint-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}.XXXXXXXX", passes the workspace-relative path to wagoid through a step output, and theif: always()cleanup removes only that directory (guarded on the output being set).Why: review finding on PR #40 by radiusred-checky: a fixed path is caller-owned territory, so an adopting repository that already had
.radiusred-commitlint/would have itscommitlint.config.mjsoverwritten and the whole directory, unrelated files included, deleted by the cleanup.mktemp -dcreates a uniquely named directory atomically and fails rather than reuse an existing one, so the action never writes into or deletes anything it did not create. The reason for staging in the workspace at all (wagoid resolvesconfigFileagainst the workspace inside its container, where the action directory is not mounted) is unchanged.fix: stage the commitlint config in a directory the action creates (#39)
ci: add a shared commitlint action carrying the org config (#39)
ci: lint this repository's commits through the shared action (#39)
docs: document adopting the shared commitlint action (#39)
fix: stage the commitlint config in a directory the action creates (#39)