Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement GHA workflow that scans the website file tree for broken links #157

Merged
merged 62 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
80ff31e
new branch with recent main changes
kaijli Jan 14, 2025
c31dff9
trying a different spell checker
kaijli Jan 15, 2025
f1a84f3
fix syntax error
kaijli Jan 15, 2025
618082e
update dictionary and json path
kaijli Jan 15, 2025
94e93e7
update dictionary and remove env vars
kaijli Jan 15, 2025
e148242
testing with import
kaijli Jan 15, 2025
349cf26
split yml into two
kaijli Jan 15, 2025
762fa5d
remove the need build
kaijli Jan 15, 2025
7f30a3a
recombined files, changed call order
kaijli Jan 15, 2025
e49d7e4
change spell check output
kaijli Jan 15, 2025
c3d6013
added resource links
kaijli Jan 15, 2025
62f52ce
typo
kaijli Jan 15, 2025
8a7c3f7
fix logic for spell check ticket creation
kaijli Jan 15, 2025
720dafa
trying to grab workflow outputs
kaijli Jan 15, 2025
30b3adc
pipe std out for spell check
kaijli Jan 15, 2025
4df4582
changed allow list name and link check call
kaijli Jan 17, 2025
746549a
removed file used to test
kaijli Jan 17, 2025
f5613c4
remove uses in link check
kaijli Jan 17, 2025
239e7d8
use verbose mode
kaijli Jan 17, 2025
ac9f592
testing npx usage
kaijli Jan 17, 2025
fa4fded
merge main into this branch for testing
kaijli Jan 17, 2025
d5bd79b
Merge branch 'main' into 61-add-link-checker
kaijli Jan 17, 2025
ab1a28e
add quiet mode
kaijli Jan 17, 2025
abb4a97
tee stdout instead of pipe
kaijli Jan 17, 2025
91f526a
change error search
kaijli Jan 17, 2025
4f80cd0
use boolean to activate github issue creation
kaijli Jan 17, 2025
728a56d
check output files
kaijli Jan 17, 2025
d3a8e46
testing json usage
kaijli Jan 17, 2025
4621a31
check syntax
kaijli Jan 17, 2025
20dc8c3
remove commented code
kaijli Jan 17, 2025
27f3287
i don't know why it's not working
kaijli Jan 17, 2025
035303e
change logic for ticket creation
kaijli Jan 17, 2025
1cf9473
try again with github output var
kaijli Jan 17, 2025
02a99c9
testing spell check issue creation
kaijli Jan 17, 2025
1fb1618
all parts working, generating pr
kaijli Jan 17, 2025
795e3f3
commenting out pull request run because logically, it needs some thin…
kaijli Jan 17, 2025
839c64d
retesting checkers
kaijli Jan 28, 2025
e630bab
add second link checker and pause issue creation
kaijli Jan 28, 2025
74a2523
put another link checker in to test
kaijli Jan 29, 2025
8cf2c58
remove other test link checkers and update artifact paths
kaijli Jan 29, 2025
4b32e6d
Merge branch 'main' into 61-add-link-checker
eecavanna Jan 29, 2025
91a06ec
Use `lychee` to scan website file tree for broken links
eecavanna Jan 29, 2025
91088ff
Configure workflow to only run when invoked by another workflow
eecavanna Jan 29, 2025
fce879c
Specify correct website root directory to `lychee` (oops)
eecavanna Jan 29, 2025
e2a393e
Bump `lycheeverse/lychee-action` to version 2
eecavanna Jan 29, 2025
38726a9
Merge branch 'main' into 61-add-link-checker
eecavanna Jan 30, 2025
4fcfd50
Update checker(s) workflow to depend upon `assemble-website` workflow
eecavanna Jan 30, 2025
5597395
Untar the artifact archive into a file tree before scanning it
eecavanna Jan 30, 2025
1999766
Create destination directory before using it (oops)
eecavanna Jan 30, 2025
c1e4c6a
Delete obsolete config file
eecavanna Jan 30, 2025
f80ac6e
Check out commit so job has access to `spellcheck_allow_list.txt`
eecavanna Jan 30, 2025
01a709e
Move the spellcheck allow list into new `supporting_files` subdirectory
eecavanna Jan 30, 2025
0269e8a
Separate the link check and spell check into two GHA workflows
eecavanna Jan 30, 2025
6e733ea
Clarify step name
eecavanna Jan 30, 2025
b0bd752
Invoke `spellchecker-cli` via off-the-shelf action instead of via `npx`
eecavanna Jan 30, 2025
9f30640
Trigger checker workflows from assembler workflow (instead of opposite)
eecavanna Jan 30, 2025
6797ef1
Avoid compiling home docs multiple times per PR update
eecavanna Jan 30, 2025
fe43af5
Bump `spellchecker-cli-action` to latest version
eecavanna Jan 30, 2025
693cfb5
Create directory before using it
eecavanna Jan 30, 2025
1412bbd
Only create GitHub Issue about broken links if processing `main` branch
eecavanna Jan 30, 2025
3c6ee67
Dump path of working directory (for debug)
eecavanna Jan 30, 2025
dfa5427
Delete preliminary spell checking GHA workflow and supporting files
eecavanna Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix syntax error
  • Loading branch information
kaijli committed Jan 15, 2025
commit f1a84f31fc4a097b7d7c77dc99f48c352e2f05ce
52 changes: 2 additions & 50 deletions .github/workflows/check-links-and-spelling.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ env:
DICTIONARY_FILE: .github/workflows/dictionary.txt

jobs:

compile-home-docs:
name: Compile home docs
uses: ./.github/workflows/compile-home-docs.yml
@@ -35,8 +34,6 @@ jobs:

build:
name: Compile main website
# This job depends upon other jobs succeeding.
# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds
needs:
- compile-home-docs
- fetch-and-compile-runtime-docs
@@ -71,7 +68,6 @@ jobs:
with:
path: _build/html


check-links:
name: Check Links in Documentation
needs: build
@@ -93,7 +89,7 @@ jobs:
max-depth: -1
file-extension: '.html'
base-branch: 'main'
- name: Save Link Check Output
- name: Save Link Check Output
run: |
mkdir -p linkcheck_reports
# Save the output to a file
@@ -142,7 +138,6 @@ jobs:
--plugins spell indefinite-article repeated-words syntax-mentions syntax-urls \
--reports $JSON_FILE


- name: Create GitHub Issue for Misspellings
if: ${{ steps.spellchecker-cli.conclusion == 'success' }}
uses: peter-evans/create-issue-from-file@v4
@@ -151,47 +146,4 @@ jobs:
content-filepath: $JSON_FILE
labels: documentation, spelling-error

# ------------------ Link Checking ------------------
# - name: Hyperlink link checker
# uses: untitaker/hyperlink@0.1.43
# id: linkcheck
# with:
# args: _build/html/ --check-anchors --continue

# - name: Create GitHub Issue listing broken links
# if: ${{ success() && steps.linkcheck.outputs.broken-links != '' }}
# uses: peter-evans/create-issue-from-file@v4
# with:
# title: Documentation contains broken links
# content-filepath: './linkcheck_report.txt'
# labels: documentation, broken-link

# - name: Use Lychee to check for broken links
# # This step will populate `env.lychee_exit_code` with the exit code returned by lychee.
# # Possible exit codes: https://github.com/lycheeverse/lychee?tab=readme-ov-file#exit-codes
# # Reference: https://github.com/lycheeverse/lychee-action
# id: lychee
# uses: lycheeverse/lychee-action@v1.9.0
# with:
# # Reference: https://github.com/lycheeverse/lychee#commandline-parameters
# args: --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
# debug: true
# output: ./lychee/out.md
# fail: false
# - name: Create GitHub Issue listing broken links
# # This step will only run if lychee returned a non-zero exit code.
# # Reference: https://docs.github.com/en/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values
# if: ${{ env.lychee_exit_code != 0 }}
# uses: peter-evans/create-issue-from-file@v4
# with:
# title: Markdown docs contain broken links
# content-filepath: ./lychee/out.md
# labels: documentation, broken-link

# - uses: actions/checkout@v4
# - name: Run linkspector
# uses: UmbrellaDocs/action-linkspector@v1.2.4
# with:
# github_token: ${{ secrets.github_token }}
# reporter: github-pr-review
# fail_on_error: false