Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gh actions early success if change is docs only
Fixes GoogleContainerTools#6032, add code to not run Github Actions on docs-only changes. This PR: - Updates linux and osx github actions to check if the PR only changes docs/* files and if so, pass the test w/o running the full test suite Github actions does not have support for exiting the job from a step easily. See: - https://stackoverflow.com/questions/60589373/how-to-force-to-exit-in-github-actions-step - actions/runner#662 The approach here uses an env var and checks this env var in all subsequent steps, this way no single command fails and tests are skipped as desired. The downside is that all subsequent steps need to have this check but there is no better solution at the moment from my investigation I considered directly using the the 'conclusion' value github actions provides, eg: - "if: steps.s1.conclusion == 'failure'" but I believe that if a step fails then the test fails which is not what we want. There shouldn't be any side effects w/ this approach, all steps have a conditional on the docs-only check and should work correctly as before in the non-docs file are updated case N/A. Future work generally might include a tag that also skips testing but is not directly related
- Loading branch information