Skip to content

Commit 39bf118

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

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.readthedocs.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ build:
44
os: ubuntu-24.04
55
tools:
66
python: "3.12"
7-
87
commands:
8+
- |
9+
set +e
10+
if git rev-parse --verify -q HEAD^ >/dev/null; then
11+
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
12+
else
13+
CHANGED_FILES=""
14+
fi
15+
echo "Changed files: $CHANGED_FILES"
16+
if [ -n "$CHANGED_FILES" ] && ! echo "$CHANGED_FILES" | grep -qE '\.(po|yaml|yml)$'; then
17+
echo "No documentation-relevant files changed, skipping build."
18+
exit 183
19+
fi
20+
echo "Continuing build."
21+
exit 0
922
- git clone --depth 1 --branch v3.14.6 https://github.com/python/cpython venv/cpython
1023
- pip install -r venv/cpython/Doc/requirements.txt
1124
- mkdir -p venv/cpython/Doc/locales/fa/LC_MESSAGES
@@ -20,4 +33,4 @@ build:
2033
-D gettext_allow_fuzzy_translations=1
2134
-D html_theme_options.is_rtl=1
2235
venv/cpython/Doc
23-
$READTHEDOCS_OUTPUT/html
36+
$READTHEDOCS_OUTPUT/html

0 commit comments

Comments
 (0)