File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Read the Docs PR preview
2+
3+ on :
4+ pull_request_target :
5+ types :
6+ - opened
7+ - synchronize
8+
9+ permissions :
10+ contents : read
11+ pull-requests : write
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+ cancel-in-progress : true
16+
17+ jobs :
18+ documentation-links :
19+ runs-on : ubuntu-latest
20+ if : github.event.repository.fork == false
21+ steps :
22+ - uses : actions/checkout@v4
23+
24+ - name : Check for docs changes
25+ id : docs_changes
26+ run : |
27+ # Fetch the PR head
28+ git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-head
29+
30+ # Show diff between base (current checkout) and PR head
31+ if git diff --name-only HEAD pr-head | grep -q '^docs/'; then
32+ echo "docs_changed=true" >> "$GITHUB_OUTPUT"
33+ else
34+ echo "docs_changed=false" >> "$GITHUB_OUTPUT"
35+ fi
36+
37+ - uses : readthedocs/actions/preview@v1
38+ if : steps.docs_changes.outputs.docs_changed == 'true'
39+ with :
40+ project-slug : " pybind11"
41+ single-version : " true"
You can’t perform that action at this time.
0 commit comments