From 3f6ed0fc574bf63e530f541aa16db79733a27802 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 20 Feb 2026 10:06:34 -0600 Subject: [PATCH 1/3] Update format check to provide suggestions if the a PR label is present. --- .github/workflows/format-check.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index cef14ca2c8c..68c37c8083f 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -5,6 +5,12 @@ on: workflow_dispatch: pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled branches: - develop - master @@ -12,6 +18,9 @@ on: jobs: cpp-linter: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - uses: actions/checkout@v4 - uses: cpp-linter/cpp-linter-action@v2 @@ -23,10 +32,16 @@ jobs: files-changed-only: true tidy-checks: '-*' version: '15' # clang-format version + format-review: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'cpp-format-suggest') }} + passive-reviews: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'cpp-format-suggest') }} file-annotations: true step-summary: true extensions: 'cpp,h' - name: Failure Check if: steps.linter.outputs.checks-failed > 0 - run: echo "Some files failed the formatting check! See job summary and file annotations for more info" && exit 1 + run: | + echo "Some files failed the formatting check." + echo "See job summary and file annotations for details." + echo "To request inline suggestions on the next PR update, add the 'cpp-format-suggest' label to this pull request." + exit 1 From 2e6fcb8b0a1f937a844c6627b76e4a6f282117a4 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 20 Feb 2026 13:00:29 -0600 Subject: [PATCH 2/3] Improve messaging regarding instructions for inline commits --- .github/workflows/format-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 68c37c8083f..1d2f832d72c 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -44,4 +44,5 @@ jobs: echo "Some files failed the formatting check." echo "See job summary and file annotations for details." echo "To request inline suggestions on the next PR update, add the 'cpp-format-suggest' label to this pull request." + echo "This workflow can be triggered by re-running it or pushing a new commit to the pull request." exit 1 From 351f374bf7cf5d7150f84991a86adf0ee1b15fb5 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 20 Feb 2026 13:12:48 -0600 Subject: [PATCH 3/3] Adding comment to PR if label is missing and format check fails --- .github/workflows/format-check.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 1d2f832d72c..42b28b2cdc6 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -38,11 +38,23 @@ jobs: step-summary: true extensions: 'cpp,h' + - name: Comment with suggestion instructions + if: steps.linter.outputs.checks-failed > 0 && !contains(github.event.pull_request.labels.*.name, 'cpp-format-suggest') + uses: actions/github-script@v7 + with: + script: | + const {owner, repo} = context.repo; + const issue_number = context.payload.pull_request.number; + await github.rest.issues.createComment({ + owner, + repo, + issue_number, + body: "C++ formatting checks failed. Add the `cpp-format-suggest` label to this PR for inline formatting suggestions on the next run." + }); + - name: Failure Check if: steps.linter.outputs.checks-failed > 0 run: | echo "Some files failed the formatting check." echo "See job summary and file annotations for details." - echo "To request inline suggestions on the next PR update, add the 'cpp-format-suggest' label to this pull request." - echo "This workflow can be triggered by re-running it or pushing a new commit to the pull request." exit 1