ci(commit_checks): accept a backport tag in release branch PR titles

Backport PRs are titled "[BACKPORT 1.18] fix(mavlink): ...". The PR title
check anchors on the conventional commit type, so it fails all of them
even though the header after the tag is valid. Replaying the check over
the 210 PRs opened against release/1.16, release/1.17 and release/1.18,
62 fail only because of the tag.

Skip a leading backport tag before validating the header. The header
after the tag still has to be a conventional commit. The tag is accepted
only on PRs that target a release/* branch, so a backport opened against
main by mistake fails with a comment that says so. The title suggested
in the failure comment keeps the tag.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche committed 2026-11-16 10:33:46 -08:00
1 parent 0b7837cccf
commit 40fee1673f
6 files changed
+134 -11

No files matched your search

+3 -2
View File
@@ -32,8 +32,9 @@ jobs:
id: check
env:
PR_TITLE: ${{ github.event.pull_request.title }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
python3 Tools/ci/check_pr_title.py "$PR_TITLE" --markdown-file comment.md && rc=0 || rc=$?
python3 Tools/ci/check_pr_title.py "$PR_TITLE" --base-ref "$BASE_REF" --markdown-file comment.md && rc=0 || rc=$?
echo "exit_code=$rc" >> "$GITHUB_OUTPUT"
- name: Post or clear comment
@@ -57,7 +58,7 @@ jobs:
# Output the entire content of the comment on the job log as a substitute for the comment.
tee -a "$GITHUB_STEP_SUMMARY" < comment.md
else
echo "::error::PR title does not follow conventional commits format. See the PR comment for details."
echo "::error::PR title check failed. See the PR comment for details."
fi
exit 1