From 4742fdbb2ee0b0472b8d7835682b89085c3c98d7 Mon Sep 17 00:00:00 2001 From: Balduin Date: Mon, 16 Nov 2026 14:45:17 +0100 Subject: [PATCH] ci(commit_checks): explain PR title failure when no comment is posted (#29816) * ci(commit_checks): render the PR title report in the job summary for forks On PRs from forks, CI cannot post comments directly. When the PR title does not satisfy conventional commits, a CI error refers to a PR comment that did not exist. Fix: Output the content of the comment in case of fork PRs - In the action summary, properly rendered like the real comment - In the job log, as plain text --------- Signed-off-by: Balduin --- .github/workflows/commit_checks.yml | 7 ++++++- Tools/ci/check_pr_title.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit_checks.yml b/.github/workflows/commit_checks.yml index 0ef67cfc5e9..59fd1f81776 100644 --- a/.github/workflows/commit_checks.yml +++ b/.github/workflows/commit_checks.yml @@ -53,7 +53,12 @@ jobs: - name: Result if: steps.check.outputs.exit_code != '0' run: | - echo "::error::PR title does not follow conventional commits format. See the PR comment for details." + if [ "$IS_FORK" = "true" ]; then + # 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." + fi exit 1 pr-body: diff --git a/Tools/ci/check_pr_title.py b/Tools/ci/check_pr_title.py index 5ef2663f8a7..4d500e66bf4 100755 --- a/Tools/ci/check_pr_title.py +++ b/Tools/ci/check_pr_title.py @@ -120,8 +120,8 @@ def format_markdown(title: str) -> str: ]) lines.extend([ - "**To fix this:** click the ✏️ next to the PR title at the top " - "of this page and update it.", + "**To fix this:** click the ✏️ next to the PR title " + "and update it.", "", "See [CONTRIBUTING.md](https://github.com/PX4/PX4-Autopilot/blob/main/CONTRIBUTING.md#commit-message-convention) " "for details.",