Skip to content

Commit 501947c

Browse files
authored
Only run the docs link check on the container (NVIDIA-NeMo#13068)
* Only run docs link check if docs changed Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Modify docs readme to trigger link check Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent db23968 commit 501947c

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/gh-docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,35 @@ jobs:
4444
steps:
4545
- name: Checkout
4646
uses: actions/checkout@v4
47+
48+
- name: Get changed files
49+
id: changed-files
50+
uses: step-security/changed-files@v45.0.1
51+
with:
52+
files: docs/**
53+
files_separator: ","
54+
separator: " "
55+
4756
- name: Set up Python ${{ env.PYTHON_VERSION }}
57+
if: steps.changed-files.outputs.any_changed == 'true'
4858
uses: actions/setup-python@v5
4959
with:
5060
python-version: ${{ env.PYTHON_VERSION }}
61+
5162
- name: Install Sphinx dependencies
63+
if: steps.changed-files.outputs.any_changed == 'true'
5264
run: python3 -m pip install -r requirements/requirements_docs.txt
65+
5366
- name: Linkcheck docs build
67+
if: steps.changed-files.outputs.any_changed == 'true'
5468
run: make -C docs linkcheck || true
69+
5570
- name: Eliminate false positives
71+
if: steps.changed-files.outputs.any_changed == 'true'
5672
run: ./docs/check_for_broken_links.sh
73+
5774
- name: Upload linkcheck output
75+
if: steps.changed-files.outputs.any_changed == 'true'
5876
uses: actions/upload-artifact@v4
5977
with:
6078
name: linkcheck-artifact

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Instead of adding those to the `docs/false_positives.json` file, it would be bes
5555
reference using a [:ref:](https://www.sphinx-doc.org/en/master/usage/referencing.html#role-ref).
5656

5757
For example, instead of writing `Modules <../api.html#modules>` to link to the modules section of
58-
a `api.rst` file, write it as ``:ref:`Modules <asr-api-modules>` ``. And in the `api.rst` file,
59-
add this label before the section being linked to:
58+
a `api.rst` file, write it as ``:ref:`Modules <asr-api-modules>` ``. And in the `api.rst` file, add
59+
this label before the section being linked to:
6060

6161
```
6262
.. _asr-api-modules:

0 commit comments

Comments
 (0)