File tree Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -83,21 +83,37 @@ jobs:
83
83
run : |
84
84
sphinx-build -D language=es -b html . _build/html
85
85
86
- check-links :
86
+ link-check-diff :
87
+ # This job is sourced from https://github.com/aiven/devportal/blob/main/.github/workflows/linkcheck-changed-files.yaml
88
+ # It is CC 4.0 I licensed: https://creativecommons.org/licenses/by/4.0/
89
+ # Changes have been made.
87
90
runs-on : ubuntu-latest
88
91
steps :
89
- - uses : actions/checkout@v3
90
- with :
91
- fetch-depth : 0
92
- - uses : actions/setup-python@v4
93
- with :
94
- python-version : 3.9
95
- - name : Install Dependencies
96
- run : |
97
- pip install -r source/requirements.txt
98
- - name : Check Links
99
- run : |
100
- make linkcheck
92
+ - uses : actions/checkout@v3
93
+ with :
94
+ fetch-depth : 0
95
+ - name : Get changed files
96
+ id : changed-files
97
+ uses : tj-actions/changed-files@v24
98
+ - uses : actions/setup-python@v4
99
+ with :
100
+ python-version : 3.9
101
+ - name : Install Dependencies
102
+ run : pip install -r source/requirements.txt
103
+ - name : Run linkcheck on .rst files
104
+ run : |
105
+ for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
106
+ if [ "${file: -4}" == ".rst" ]
107
+ then
108
+ var="$var $file"
109
+ fi
110
+ done
111
+ if [ -z "$var" ]
112
+ then
113
+ echo "No *.rst changed files to check."
114
+ else
115
+ make BUILDER_ARGS="$var" linkcheck
116
+ fi
101
117
102
118
check-linting :
103
119
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ LINTEROPTS = --ignore D001 # D001 is linelength
11
11
SIZECHECKER = python3 -m scripts.imagesizechecker
12
12
CONFEXCLUDE = --exclude-file source/conf.py
13
13
SIZEMAX = 500
14
+ BUILDER_ARGS ?=
14
15
15
16
ifeq ($(CI ) , true)
16
17
SPHINXOPTS += --color
@@ -31,4 +32,4 @@ sizecheck:
31
32
# Catch-all target: route all unknown targets to Sphinx using the new
32
33
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
33
34
% : Makefile
34
- @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
35
+ @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(BUILDER_ARGS ) $( SPHINXOPTS ) $(O )
You can’t perform that action at this time.
0 commit comments