Skip to content

fix(commit-lint): gate on pull_request events only (same pattern as jira-ticket-check)#150

Merged
pdodgen-revparts merged 1 commit into
mainfrom
devex-1698-commit-lint-pr-only
Jul 9, 2026
Merged

fix(commit-lint): gate on pull_request events only (same pattern as jira-ticket-check)#150
pdodgen-revparts merged 1 commit into
mainfrom
devex-1698-commit-lint-pr-only

Conversation

@pdodgen-revparts

Copy link
Copy Markdown
Contributor

Symptom

encodium/manage run 29053841708 — squash-merge of encodium/manage#7671 (DEVEX-1653 on_rt sweep) landed on main. The Pull Request Workflow re-fired on push:main, and commit-lint came back red:

  • Squash commit subject: DEVEX-1653: thread on_rt input through deploy chain for Slack RT/Hotfix badge (taken from PR title per GitHub's default squash behavior)
  • commitlint config-conventional: rejects — the subject starts with a Jira ticket ID, not a conventional type prefix (feat:, fix:, ci:, …)
  • The failed check triggered the shared ci-failure-notify chain (DEVEX-1398) → #releases got a "check failed on main" alert that looks like a build failure but is actually cosmetic

Every squash-merge from any repo using the org PR-title convention (<TICKET-ID>: <terse description>) hits this. Manage is just the most visible because it merges frequently.

Fix

Add if: github.event_name == 'pull_request' to the commitlint job in the shared git-commit-lint.yaml. Same pattern I landed on jira-ticket-check.yaml in .github#144. On push:main the check skips (yellow), no false-negative fires.

Why not enforce commitlint on the squash-merge subject

Two paths considered:

  • Fix the check (this PR): commit-lint on push:main adds no new signal — the PR's original commits were already commit-linted at PR time. The squash-merge subject is a mechanical concatenation from the PR title, not a human-authored commit. Re-checking it fires false-negatives whenever the org PR-title convention doesn't match commitlint's rules.
  • Fix the convention: change PR-title convention org-wide to include a conventional type prefix (e.g. feat: DEVEX-1653 thread on_rt…). Breaks existing muscle memory + tooling, doesn't add value.

Path 1 is cheaper and matches the pattern we established for jira-ticket-check.

Verification

Next squash-merge to any repo using this workflow. The commit-lint job should render as skipped (yellow) on push:main, not failed (red). PR-time commit-lint on pull_request events is unchanged.

…et-check)

Follow-up to .github#144. That PR gated jira-ticket-check on
pull_request events only; commit-lint has the same false-negative
mode and needs the same fix.

Symptom (from encodium/manage#29053841708, 2026-07-09): a squash-merge
PR titled 'DEVEX-1653: thread on_rt input through deploy chain for
Slack RT/Hotfix badge' lands on main. GitHub's default squash behavior
uses the PR title as the commit subject. The org PR-title convention
starts with a Jira ticket ID, not a conventional-commits type prefix,
so commitlint's config-conventional rejects it on push:main. The
shared ci-failure-notify chain (DEVEX-1398) posts a 'check failed on
main' alert to #releases that looks like a build failure but is
actually just this cosmetic re-check on a mechanically-generated
subject.

Fix: skip the check on push. The PR's original commits were already
commit-linted at PR time — the re-run on main adds no new signal, only
noise. If we ever want to enforce commitlint on the squash-merge
subject too, the right move is to change the PR-title convention
org-wide, not to keep re-running the check where it always fails.

Verification plan: next squash-merge to any repo using this shared
workflow. The commit-lint job should show as skipped (yellow) on
push:main, not failed (red).
@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI-only workflow condition change; PR commit linting is unchanged and push:main simply skips the job.

Overview
Stops commit-lint from running on push:main in the shared git-commit-lint.yaml reusable workflow by adding if: github.event_name == 'pull_request', matching the existing jira-ticket-check gate.

Squash-merge subjects use the org PR title (<TICKET-ID>: …), so commitlint fails on main even though PR-time lint already passed, which triggers false #releases CI failure alerts. The job still runs on pull requests; it is skipped (not failed) after merge.

Reviewed by Cursor Bugbot for commit 8f469ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@pdodgen-revparts
pdodgen-revparts marked this pull request as ready for review July 9, 2026 22:49
@pdodgen-revparts
pdodgen-revparts requested a review from a team as a code owner July 9, 2026 22:49
@pdodgen-revparts
pdodgen-revparts merged commit 76b1388 into main Jul 9, 2026
2 checks passed
@pdodgen-revparts
pdodgen-revparts deleted the devex-1698-commit-lint-pr-only branch July 9, 2026 22:50
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