Skip to content

Commit

Permalink
Merge pull request #681 from collective/improve-rtd-pull-request-prev…
Browse files Browse the repository at this point in the history
…iew-git-diff

Improve rtd pull request preview git diff
  • Loading branch information
niccokunzmann committed Jul 3, 2024
2 parents 4ea4980 + 274b053 commit 04bea14
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/rtd-pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .github/workflows/rtd-pr-preview.yml
name: readthedocs/actions
on:
pull_request_target:
types:
- opened
# Execute this action only on PRs that touch
# documentation files.
paths:
- "docs/**"
- "*.rst"
- "src/icalendar/*.py"
- .readthedocs.yaml
- requirements_docs.txt

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "icalendar"
single-version: "true"
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ build:
# 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 -- docs/ src/icalender/*.py CHANGES.rst CONTRIBUTING.rst LICENSE.rst README.rst .readthedocs.yaml requirements_docs.txt;
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- . docs/ src/icalendar/*.py *.rst .readthedocs.yaml requirements_docs.txt ':!src/icalendar/fuzzing' ':!src/icalendar/tests' ':!src/icalendar/timezone';
then
exit 183;
fi
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ New features:
- Test compatibility with Python 3.12
- Add function ``icalendar.use_pytz()``.
- Add `sphinx-autobuild` for `livehtml` Makefile target.
- Add pull request preview on Read the Docs, building only on changes to documentation-related files.
- Add link to pull request preview builds in the pull request description only when there are changes to documentation-related files.
- Add documentation of live HTML preview of documentation and clean up of ``install.rst``.

Bug fixes:
Expand Down

0 comments on commit 04bea14

Please sign in to comment.