Repository navigation
test: add a workflow that tests the action on a real PR - #72
Merged
Merged
Conversation
"Run workflow" opens a PR with known lint problems, runs the chosen cpp-linter-action ref on it on 3 operating systems, checks the thread comment, review, annotations and outputs, and reports the result.
2bndy5
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now, testing a cpp-linter-action branch or release candidate on a real pull request was done by hand: make a branch with bad code, open a temporary PR, read the comments, close it. This workflow does those steps.
How it works
e2e on a real PR(.github/workflows/e2e-pr.yml):mainorv3.0.0-rc0) and a clang version. Theopen-prjob creates a branche2e/run-<id>, copies.github/e2e/demo.cpp.txtoversrc/demo.cpp(known clang-tidy and clang-format problems), writes the target to.github/e2e/target.env, and opens a PR.lintjob checks out the action at the chosen ref and runs it on Linux, macOS and Windows withlines-changed-only: true. Only the Linux job posts to the PR (thread comment, review, annotations), so the jobs do not overwrite each other.verifyjob reads the PR through the API and checks: the outputs of each OS, exactly one thread comment, a review that requests changes, review comments, and file annotations onsrc/. It posts the table as a PR comment.The existing workflows are not changed. The fixture is named
.txtso that their full scans do not pick it up.One limitation
GitHub does not start workflows for a PR that was opened with the default
GITHUB_TOKEN. So after step 1, either:E2E_TOKEN(a fine-grained token with "Contents" and "Pull requests" write access to this repo). The workflow uses it when it exists, and then everything runs from the one click.Tested
Trial run in #71, a temporary PR made the same way the
open-prjob makes one, againstcpp-linter-action@main: all checks passed on the 3 systems (6 findings each: 5 clang-tidy, 1 clang-format; 1 thread comment, 1 review with 4 comments, 6 annotations), and the PR was closed and its branch deleted by the workflow. Theopen-prjob itself can only run once the workflow is onmaster.actionlint passes. The actions are pinned to the same commit as in the other org repos.