Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/workflows/readthedocs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ on:
- .readthedocs.yaml
- README.md
- docs/**
- pdm.lock
permissions:
pull-requests: write
9 changes: 9 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ build:
post_checkout:
- env | sort
- git fetch --unshallow || true
# Cancel building pull requests when there aren't changed in the related files and folders.
# 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.
# Ref: https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- README.md;
then
exit 183;
fi
post_install:
- python -m pip install --upgrade --no-cache-dir pdm
- PDM_NO_EDITABLE=true make dev-doc
Expand Down
2 changes: 1 addition & 1 deletion copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _envops:
block_start_string: '[%'
_subdirectory: template
_message_before_copy: |
Thanks for generating a project using our template.
Thanks for generating a project using our template.1

You'll be asked a series of questions whose answers will be used to
generate a tailored project for you.
Expand Down
9 changes: 9 additions & 0 deletions template/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ build:
post_checkout:
- env | sort
- git fetch --unshallow || true
# Cancel building pull requests when there aren't changed in the related files and folders.
# 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.
# Ref: https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- README.md;
then
exit 183;
fi
post_install:
- python -m pip install --upgrade --no-cache-dir pdm
- PDM_NO_EDITABLE=true make dev-doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ on:
- .readthedocs.yaml
- README.md
- docs/**
- pdm.lock
permissions:
pull-requests: write