fix: use dorny/paths-filter to include/skip a job with a required status. #651
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.
Overview
I can't merge #645, because GitHub says I am missing a required status. What status that might be isn't obvious.
GitHub's docs say:
It turns out that "paths-ignore" doesn't solve the problem. See https://github.com/orgs/community/discussions/13690
This PR takes two jobs that report a required status, and skips them with a conditional. If this works out (can't test it against the real statuses until it's merged to master), I'll copy this to the other workflows that generate required statuses.
Here is the workflow working on this PR: https://github.com/dfinity/examples/actions/runs/7674715486/job/20919794867?pr=651
Here is the workflow skipping both jobs in another PR: https://github.com/dfinity/examples/actions/runs/7674641514/job/20919580001?pr=650
Considered Solutions
I considered running the required jobs unconditionally, which would have been simpler, but also would have run tests unnecessarily.
Considerations
This will require a runner to evaluate the conditional, but it doesn't have to check out the repo.