Skip to content

ci: check commit messages and the PR description against the team message standard - #414

Merged
ajianaz merged 2 commits into
developfrom
ci/message-standard
Oct 21, 2026
Merged

ajianaz merged 2 commits into
developfrom
ci/message-standard

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

A new Message Standard job in PR Checks: it fails a PR when any of its commit messages, or its description, carries a line the team message standard does not allow.

Why

A squash merge can carry lines from the branch's commits into develop even when the PR description itself is clean, and once that happens it cannot be undone without rewriting shared history. Catching it on the PR is the only reliable point.

Changes

  • .github/workflows/pr-checks.yml: message-standard job (bot PRs exempt like the other checks). It reads every commit message of the PR through the API plus the PR description and matches them against the pattern in the repository variable MESSAGE_STANDARD_PATTERN. An unset variable or an invalid pattern fails the job loudly instead of passing silently (grep's error status is not read as "no match").
  • Repository settings (applied separately, not in this diff): the squash commit now uses the PR title and description instead of the concatenated commit messages.

Testing

  • Workflow YAML parses.
  • The pattern was checked against real develop history: it flags the two existing commits that carry such lines and passes clean commits and human co-author lines.
  • The job script was run locally under the Actions shell flags (bash -eo pipefail) for five cases: clean (pass), disallowed commit trailer (fail), disallowed description line (fail), invalid pattern (fail loudly), unset variable (fail loudly).
  • This PR's own run exercises the job; cora review clean.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit bba5d7c into develop Oct 21, 2026
22 checks passed
@ajianaz
ajianaz deleted the ci/message-standard branch October 21, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant