From f027b5bad0f077d26eaebed3f8412d2ff1f7a7b8 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:36:46 +0000 Subject: [PATCH 1/5] chore: run cpp-linter workflow against the checked-out action --- .github/workflows/cpp-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 78a294be..e1e639e9 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: cpp-linter/cpp-linter-action@main + - uses: ./ # test this checkout, not the published main branch id: linter continue-on-error: true env: From 72bb2d9d14d844b35e08c15e63de6a6a95e39c14 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:38:38 +0000 Subject: [PATCH 2/5] chore: remove cpp-linter workflow covered by self-test --- .github/workflows/cpp-linter.yml | 39 -------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/cpp-linter.yml diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml deleted file mode 100644 index e1e639e9..00000000 --- a/.github/workflows/cpp-linter.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: cpp-linter - -on: - push: - paths: - - "docs/examples/demo/*" - pull_request: - paths: - - "docs/examples/demo/*" - -permissions: {} - -jobs: - cpp-linter: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - uses: ./ # test this checkout, not the published main branch - id: linter - continue-on-error: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - style: file - files-changed-only: false - thread-comments: false - - - name: Fail fast?! - if: steps.linter.outputs.checks-failed != 0 - env: - CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }} - run: | - echo "some linter checks failed. ${CHECKS_FAILED}" - # for actual deployment - # run: exit 1 From 1b661d9058544c40bb6b11f718080846fb116a3a Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:48:32 +0000 Subject: [PATCH 3/5] chore: keep cpp-linter workflow for users' README badges --- .github/workflows/cpp-linter.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/cpp-linter.yml diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml new file mode 100644 index 00000000..072a0d23 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,43 @@ +# Lints the demo files with the action from this checkout. +# Keep this file: older READMEs told users to add the status badge of this +# workflow (actions/workflows/cpp-linter.yml/badge.svg) to their own README, +# and those badges break if the workflow is removed or renamed. +name: cpp-linter + +on: + push: + paths: + - "docs/examples/demo/*" + pull_request: + paths: + - "docs/examples/demo/*" + +permissions: {} + +jobs: + cpp-linter: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: ./ + id: linter + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + files-changed-only: false + thread-comments: false + + - name: Fail fast?! + if: steps.linter.outputs.checks-failed != 0 + env: + CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }} + run: | + echo "some linter checks failed. ${CHECKS_FAILED}" + # for actual deployment + # run: exit 1 From 5a20237a334002b419ba90dfda1afeded88b2b1f Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:49:16 +0000 Subject: [PATCH 4/5] docs: add a cpp-linter badge section to the README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 235ddede..3b0fe29e 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,23 @@ clang tools. Linux workflows that use a specific [`container`][gh-container-synt packages installed first. [Required tools][tools-doc] lists them and the sources each runner installs the clang tools from. +## Add a badge + +Show that your project is linted with cpp-linter by adding this badge to your README: + +[![C/C++ lint: cpp-linter](https://img.shields.io/badge/C%2FC%2B%2B%20lint-cpp--linter-ffc20a?labelColor=454a63)](https://github.com/cpp-linter/cpp-linter-action) + +```markdown +[![C/C++ lint: cpp-linter](https://img.shields.io/badge/C%2FC%2B%2B%20lint-cpp--linter-ffc20a?labelColor=454a63)](https://github.com/cpp-linter/cpp-linter-action) +``` + +To also show the result of your own lint runs, add the status badge of the workflow from +[Quick start](#quick-start), replacing `OWNER/REPO` with your repository: + +```markdown +[![cpp-linter](https://github.com/OWNER/REPO/actions/workflows/cpp-linter.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/cpp-linter.yml) +``` + ## Used by Projects from these organizations run cpp-linter-action on their default branch: From 3e6a59053ca3062dc55397b56cd49f82c6b82e9b Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:50:11 +0000 Subject: [PATCH 5/5] chore: pin cpp-linter workflow to the latest release --- .github/workflows/cpp-linter.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 072a0d23..586db3bf 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -1,4 +1,5 @@ -# Lints the demo files with the action from this checkout. +# Runs the latest release on the demo files, the way users run the action. +# Changes to the action itself are tested by self-test.yml. # Keep this file: older READMEs told users to add the status badge of this # workflow (actions/workflows/cpp-linter.yml/badge.svg) to their own README, # and those badges break if the workflow is removed or renamed. @@ -23,7 +24,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: ./ + - uses: cpp-linter/cpp-linter-action@8120e05c7fbd25fa09fa93424ec49f55f7b304ab # v2.23.1 id: linter continue-on-error: true env: