ci(docs): Fail when build aborts from broken links #2266
Merged
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.
Description
This is a change originally from @NorseGaud in his PR commit here. To ease review of that PR I'm pulling out anything that doesn't need to be in it.
Using
set -ex
will exit the script as soon as a non-zero exit code is returned, such as when the docker image fails building the docs due tobuild --strict
catching broken links. This also removes the need for|| exit
when changing directory.This seems fine for a small script, but AFAIK an alternative fix is just adding
|| exit
to the end of thedocker run
command too? There appears to be advice against adopting-e
carelessly, while others encourage-e
. I know that several maintainers here have preference towardsset -e
so I've kept the original PR solution.Additionally:
-x
is used to improve command visibility when reviewing the workflow log output.--name
isn't necessary, but was part of the original PR.-o pipefail
, only because no pipes are used in this script.Type of change
Checklist:
docs/
)