Repository navigation
Description
Summary
Add a composite action actions/pr-title that checks PR titles against the org convention. Each repo calls it from a thin pr-title.yml.
Rule
The check covers the whole title, not only the subject:
- format
<type>[(scope)][!]: <description>(Conventional Commits; allowed types as configured, e.g.build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test); - at most 50 characters in total;
- no trailing period.
The current check in cloud-components (elixir-cloud-aai/cloud-components#474, using amannn/action-semantic-pull-request) limits only the subject to 50 characters, so a title like feat(access-control): … can reach about 72 characters.
Implementation
- A small script in a
run:step readsgithub.event.pull_request.titlethroughenv:(never interpolated into the script). This replaces the third-party action, needs no token and lets us match the convention exactly. - Error messages say which rule failed and show the title's length.
- Tests in the
.githubCI (set up in the blocking issue) cover good and bad titles: too long, wrong type, missing colon or space, trailing period, scope,!.
Per-repo caller
.github/workflows/pr-title.yml with:
name: PR title;- the trigger
pull_requestwith typesopened, edited, synchronize, reopened, ready_for_review; permissions: {};- one job
titlenamedPR title, skipped for Dependabot PRs with a job-levelif:. Dependabot's titles, such asci: bump the github-actions group …, often exceed 50 characters, and a skipped job satisfies a required check; - the step
uses: elixir-cloud-aai/.github/actions/pr-title@<sha> # vX.Y.Z.
The workflow template (workflow-templates/pr-title.yml) moved to #17: it pins the action by a release commit, which only exists after the first release.
Why not a reusable workflow: the check would be named PR title / <job>, and skipping the caller for Dependabot would leave the nested required check pending. Why not a ruleset "require workflows" rule: those only run on the default pull_request activity types, so fixing a title (edited) would not re-run the check.
Rollout (after release)
- Tag a release of
.githubwith the action. - cloud-components: switch the
pr-title.ymlfrom #474 to the action. - foca, cloud-registry, proTES, trs-filer and cloud-registry-ui (branch
ai): addpr-title.yml. - In each repo, add
PR titleto the ruleset after the check has reported once on a PR. A maintainer does this switch.
The per-repo rollout PRs are tracked in each repo, not here.
Part of the parent issue on sharing workflow steps as composite actions.
Activity