diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63f0fa96..e2995d4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,9 +32,23 @@ jobs: - name: "Run build test" run: | make test - - name: "Linkcheck" + - name: "Get changed files" + id: "changed-files" + uses: "tj-actions/changed-files@v24" + - name: "Run linkcheck on .rst files" run: | - make linkcheck + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + if [ "${file: -4}" == ".rst" ] + then + var="$var $file" + fi + done + if [ -z "$var" ] + then + echo "No *.rst changed files to check." + else + make files="$var" linkcheck-specified-files + fi lint: name: "Linting" runs-on: "ubuntu-22.04" diff --git a/Makefile b/Makefile index 808bd852..4a4b1e5b 100644 --- a/Makefile +++ b/Makefile @@ -187,9 +187,9 @@ changes: @echo @echo "The overview file is in $(BUILDDIR)/changes." -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck +.PHONY: linkcheck-specified-files +linkcheck-specified-files: + $(SPHINXBUILD) -q -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR) $(files) @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt."