Skip to content

Commit dcd860f

Browse files
committed
Skip RTD workflow on non-documentation changes
1 parent 9c8fbf1 commit dcd860f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.readthedocs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ build:
44
os: ubuntu-24.04
55
tools:
66
python: "3.12"
7-
87
commands:
8+
- |
9+
if [ "$READTHEDOCS_VERSION_TYPE" != "external" ]; then
10+
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD || echo "")
11+
if [ -n "$CHANGED_FILES" ] && ! echo "$CHANGED_FILES" | grep -qE '\.(po|yaml|yml)$'; then
12+
exit 183
13+
fi
14+
fi
915
- git clone --depth 1 --branch v3.14.6 https://github.com/python/cpython venv/cpython
1016
- pip install -r venv/cpython/Doc/requirements.txt
1117
- mkdir -p venv/cpython/Doc/locales/fa/LC_MESSAGES
@@ -20,4 +26,4 @@ build:
2026
-D gettext_allow_fuzzy_translations=1
2127
-D html_theme_options.is_rtl=1
2228
venv/cpython/Doc
23-
$READTHEDOCS_OUTPUT/html
29+
$READTHEDOCS_OUTPUT/html

0 commit comments

Comments
 (0)