Visitar URL original
RtD docs previews: Cancel building PRs if no changes in Doc dir by hugovk · Pull Request #104100 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The keys build.jobs and build.commands can't be used together
  • Loading branch information
hugovk committed May 2, 2023
commit e610f227f36d03fc0fcf54db51fc36f2e08d9a4d
28 changes: 13 additions & 15 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ build:
tools:
python: "3"

jobs:
post_checkout:
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
#
# Cancel building pull requests when there aren't changes in the Doc directory.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- Doc/ .readthedocs.yml;
then
echo "No changes to Doc/ - exiting the build.";
exit 183;
fi

commands:
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
#
# Cancel building pull requests when there aren't changes in the Doc directory.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- Doc/ .readthedocs.yml;
then
Comment thread
hugovk marked this conversation as resolved.
Outdated
echo "No changes to Doc/ - exiting the build.";
exit 183;
fi

- make -C Doc venv html
- mkdir _readthedocs
- mv Doc/build/html _readthedocs/html