A workflow job building documentation on every push to every branch, publishing nothing except on the default branch.
# before: 41 runs a week, 2 of which published
jobs:
docs:
steps:
- run: ./bin/build-docs
- if: github.ref == 'refs/heads/main'
run: ./bin/publish-docs
# after
docs:
if: github.ref == 'refs/heads/main'
paths: ['docs/**', 'src/**/*.php']
A conditional inside a job means the job still starts, checks out, installs and then does nothing, which is ninety seconds of runner time for the privilege of not publishing. Moving the condition to the job level is the fix and the reason it was written the other way is that the build step was also a check — which it was not, because nothing looked at its output.