Skip to content

cpp-linter fails to submit a comment #389

@kduske

Description

@kduske

What events trigger your workflow?

name: CPP Linter
on: [pull_request]

What OS does your workflow use?

runs-on: ubuntu-22.04

How is cpp-linter-action configured?

- name: Run clang-tidy
        uses: cpp-linter/cpp-linter-action@v2
        id: linter
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          version: 18
          style: 'file'  # Use .clang-format config file. 
          tidy-checks: '' # Use .clang-tidy config file.
          files-changed-only: false
          database: ${{github.workspace}}/build
          ignore: 'build|vcpkg-overlay-ports|common/src/ui/GetVersion.cpp'
          step-summary: true
          thread-comments: true
      - name: Fail fast?!
        if: steps.linter.outputs.clang-tidy-checks-failed > 0
        run: exit 1

What was the unexpected behavior?

cpp-linter fails to post a comments when it is done. This just started happening and I'm not aware of changing anything that could have caused this. Here's the relevant log excerpt (full run here):

2025-12-22T15:50:14.9913387Z ##[group]Posting comment(s)
2025-12-22T15:50:14.9927368Z Traceback (most recent call last):
2025-12-22T15:50:14.9937136Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/bin/cpp-linter", line 10, in <module>
2025-12-22T15:50:14.9938432Z     sys.exit(main())
2025-12-22T15:50:14.9938727Z              ^^^^^^
2025-12-22T15:50:14.9939569Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/lib/python3.12/site-packages/cpp_linter/__init__.py", line 85, in main
2025-12-22T15:50:14.9940321Z     rest_api_client.post_feedback(files=files, args=args, clang_versions=clang_versions)
2025-12-22T15:50:14.9941138Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/lib/python3.12/site-packages/cpp_linter/rest_api/github_api.py", line 221, in post_feedback
2025-12-22T15:50:14.9941784Z     comment = super().make_comment(
2025-12-22T15:50:14.9942005Z               ^^^^^^^^^^^^^^^^^^^^^
2025-12-22T15:50:14.9942641Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/lib/python3.12/site-packages/cpp_linter/rest_api/__init__.py", line 213, in make_comment
2025-12-22T15:50:14.9943302Z     comment += RestApiClient._make_tidy_comment(
2025-12-22T15:50:14.9943562Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-22T15:50:14.9944236Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/lib/python3.12/site-packages/cpp_linter/rest_api/__init__.py", line 275, in _make_tidy_comment
2025-12-22T15:50:14.9944901Z     diagnostic=note.diagnostic_link,
2025-12-22T15:50:14.9945127Z                ^^^^^^^^^^^^^^^^^^^^
2025-12-22T15:50:14.9945781Z   File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/.venv/lib/python3.12/site-packages/cpp_linter/clang_tools/clang_tidy.py", line 95, in diagnostic_link
2025-12-22T15:50:14.9946529Z     return link + "{}/{}.html)".format(*self.diagnostic.split("-", maxsplit=1))
2025-12-22T15:50:14.9946864Z                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-22T15:50:14.9947229Z IndexError: Replacement index 1 out of range for positional args tuple
2025-12-22T15:50:15.0290484Z ##[error]Process completed with exit code 1.
2025-12-22T15:50:15.0462777Z Post job cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions