File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,20 @@ build:
13
13
python : " 3"
14
14
15
15
commands :
16
+ # https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
17
+ #
18
+ # Cancel building pull requests when there aren't changes in the Doc directory.
19
+ #
20
+ # If there are no changes (git diff exits with 0) we force the command to return with 183.
21
+ # This is a special exit code on Read the Docs that will cancel the build immediately.
22
+ - |
23
+ if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && [ "$(git diff --quiet origin/main -- Doc/ .readthedocs.yml; echo $?)" -eq 0 ];
24
+ then
25
+ echo "No changes to Doc/ - exiting the build.";
26
+ exit 183;
27
+ fi
28
+
16
29
- make -C Doc venv html
17
30
- mkdir _readthedocs
18
31
- mv Doc/build/html _readthedocs/html
32
+
Original file line number Diff line number Diff line change 12
12
{%- if is_deployment_preview %}
13
13
< div id ="deployment-preview-warning " style ="padding: .5em; text-align: center; background-color: #fff2ba; color: #6a580e; ">
14
14
{% trans %}This is a deploy preview created from a < a href ="{{ repository_url }}/pull/{{ pr_id }} "> pull request</ a > .
15
- For authoritative documentation, see the {% endtrans %}
15
+ For authoritative documentation, see {% endtrans %}
16
16
< a href ="https://docs.python.org/3/{{ pagename }}{{ file_suffix }} "> {% trans %} the current stable release{% endtrans %}</ a > .
17
17
</ div >
18
18
{%- endif %}
You can’t perform that action at this time.
0 commit comments