I came here looking how to disable the entire.yml
file with a single condition.
Adding the conditions to each job individually is not feasible, because e.g. in a pull request, it spams a "job skipped" indicator for each skipped job, which is annoying (and duplicating the conditions is annoying).
The solution is to create a second.yml
file, and conditionally run the primary file from it. Like this:
on: # Your triggers here, not in the main file.jobs: test-pip-build: if: YOUR_CONDITION uses: ./.github/workflows/your_file.yml