Experiment with adding 'workflow_dispatch' to the CI workflow #603
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.
The Problem
When the
run-clang-formatworkflow runs and pushes changes to a PR branch, the CI workflow is not triggered to cancel/re-run. This is because the formatting workflow usesGITHUB_TOKENwhen pushing changes which cannot trigger workflows by design. This means that the CI will appear "blocked" indefinitely until either the PR is closed and re-opened (not ideal) or a new change is pushed to the branch by someone other than the bot. The latter requires that there be new changes to push, which may or may not be the case.Possible Solutions
The "recommended" solution is to store a PAT as a secret for the repo. All instructions I can find on this are for creating PATs for my profile, which isn't quite what I want... Maybe someone with more GitHub-fu can figure this out.
The alternative approach I'm experimenting with here is to add
workflow_dispatchas a trigger for the CI so that we can manually invoke the workflow. NOTE: I'm not yet confident that we can manually run the workflow for PR branches, hence why this is experimental. This unfortunately requires the definition to exist in the master branch before I can test it, though...