You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build: skip build based on commands' exit codes (#9649)
* Build: skip build based on commands' exit codes
Define a particular exit code (439) to skip a build.
If any of the commands returns this exit code, the build will be cancelled
automatically and won't run any of the following commands. When this happens,
the build will be marked as `cancelled` and no email/webhook notifications will
be sent.
Why 439 was chosen for the exit code?
It's the word "skip" encoded in ASCII. Then it's taken the 256 modulo of it because
the Unix implementation does this automatically for exit codes greater than 255
```
>>> sum(list('skip'.encode('ascii')))
439
>>> 439 % 256
183
```
* Update readthedocs/doc_builder/exceptions.py
Co-authored-by: Anthony <[email protected]>
* Build: send SUCCESS external build status on skipped builds
When the command exists with the magic exit code, we send SUCCESS to
GitHub/GitLab as status so the PR check passes and the PR can be merged.
* Docs: skip build based on a condition
* Lint: small darker change
* Docs: reference fixed
* Docs: improve comment on YAML
* Build: make usage of `status` variable
Thanks to Benjamin for pointing it to me ;)
* Apply suggestions from code review
Co-authored-by: Benjamin Balder Bach <[email protected]>
* Docs: update code example for skip builds
Use Bash's `if` to only run this code on pull requests.
* Docs: example showing how to skip the build based on commit message
* Docs: refactor "skipping a build" section (#9717)
* Docs: refactor "skipping a build" section
- Move the explanation about the "Cancelling builds" feature to the "Builds"
page
- Keep the examples (How-To) for "Cancel a build" into the "Build customization"
page
* Docs: use 183 instead of 439 exit code
> This error code isn't a valid exit
> code (tldp.org/LDP/abs/html/exitcodes.html), we shouldn't document a code above
> 255 otherwise users will get confused.
From Eric's review.
* Apply suggestions from code review
Co-authored-by: Eric Holscher <[email protected]>
* Minor fix underline
* Use multi-line bash examples
They are easier to read
* Update docs/user/builds.rst
Co-authored-by: Eric Holscher <[email protected]>
Co-authored-by: Eric Holscher <[email protected]>
* Docs: use `grep` instead of `case`
* Docs: small note about "Why 183?"
Co-authored-by: Anthony <[email protected]>
Co-authored-by: Benjamin Balder Bach <[email protected]>
Co-authored-by: Eric Holscher <[email protected]>
0 commit comments