Skip to content

Commit f417651

Browse files
committed
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.
1 parent 4303d17 commit f417651

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/user/build-customization.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To avoid this, it's possible to unshallow the clone done by Read the Docs:
108108
Cancel build based on a condition
109109
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110110

111-
When a command exits with code ``439``,
111+
When a command exits with code ``183``,
112112
Read the Docs will cancel the build immediately.
113113
We can use this approach to cancel builds we don't want to complete based on a condition.
114114

@@ -128,9 +128,9 @@ Here is an example that cancels builds from pull requests when there are no chan
128128
# `--quiet` exits with a 1 when there **are** changes,
129129
# so we invert the logic with a !
130130
#
131-
# If there are no changes (exit 0) we force the command to return with 439.
131+
# If there are no changes (exit 0) we force the command to return with 183.
132132
# This is a special exit code on Read the Docs that will cancel the build immediately.
133-
- if [ $READTHEDOCS_VERSION_TYPE = "external" ]; then ! git diff --quiet origin/main -- docs/ && exit 439; fi
133+
- if [ $READTHEDOCS_VERSION_TYPE = "external" ]; then ! git diff --quiet origin/main -- docs/ && exit 183; fi
134134
135135
136136
This other example shows how to cancel a build if the commit message contains ``skip ci`` on it:
@@ -146,8 +146,8 @@ This other example shows how to cancel a build if the commit message contains ``
146146
jobs:
147147
post_checkout:
148148
# Use `git log` to check if the latest commit contains "skip ci",
149-
# in that case exit the command with 439 to cancel the build
150-
- case `git --no-pager log --pretty="tformat:%s" -1` in *"skip ci"*) exit 439;; *);; esac
149+
# in that case exit the command with 183 to cancel the build
150+
- case `git --no-pager log --pretty="tformat:%s" -1` in *"skip ci"*) exit 183;; *);; esac
151151
152152
153153
Generate documentation from annotated sources with Doxygen

docs/user/builds.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Read the Docs supports three different mechanisms to cancel a running build:
9898
:Programatically:
9999

100100
You can use user-defined commands on ``build.jobs`` or ``build.commands`` (see :doc:`build-customization`)
101-
to check for a condition and exit it with the code ``439`` if you want to cancel the running build or ``0``, otherwise.
101+
to check for a condition and exit it with the code ``183`` if you want to cancel the running build or ``0``, otherwise.
102102

103103
In this case, Read the Docs will communicate to your Git platform (GitHub/GitLab) that the build succeeded (green tick ✅)
104104
so the pull request is in a mergeable state.

0 commit comments

Comments
 (0)