Skip to content

Commit 1462464

Browse files
committed
Add spell and link check workflow, disable legacy checks, update wordlist
- Create new spell-and-link-check.yml workflow with inline results display - Add ANSI color code stripping for clean HTML link check output - Disable content-checks.yml legacy workflow (preserved for reference) - Update .wordlist.txt: add 26 valid technical terms, remove 18 typos
1 parent 7f2c82d commit 1462464

3 files changed

Lines changed: 341 additions & 93 deletions

File tree

Lines changed: 113 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,123 @@
1-
name: Check Code Quality
1+
name: Check Code Quality (Legacy - Disabled)
22

3+
# LEGACY WORKFLOW - This workflow has been replaced by spell-and-link-check.yml
4+
# Kept for reference only. Tests are disabled.
35
on:
4-
# run once a day at 6AM UTC
5-
schedule:
6-
- cron: '0 6 * * *'
6+
# Scheduled runs disabled - use spell-and-link-check.yml instead
7+
# schedule:
8+
# - cron: '0 6 * * *'
79

8-
# Allows you to run this workflow manually from the Actions tab
10+
# Manual runs only for backward compatibility
911
workflow_dispatch:
1012

1113
jobs:
12-
check_content:
14+
legacy_notice:
1315
runs-on: ubuntu-latest
1416

1517
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
with:
19-
submodules: true
20-
fetch-depth: 0
21-
22-
- name: Setup Hugo
23-
uses: peaceiris/actions-hugo@v3
24-
with:
25-
hugo-version: '0.130.0'
26-
extended: true
27-
28-
- name: Build
29-
run: |
30-
hugo --minify
31-
bin/pagefind --site "public"
32-
33-
- name: Check HTML links
34-
continue-on-error: true
35-
run: bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log
36-
37-
- name: HTML test results
38-
uses: actions/upload-artifact@v4
39-
with:
40-
name: htmltest-report
41-
path: htmltest.log
42-
retention-days: 5 # Default is 90 days
43-
44-
- name: Spell check
45-
continue-on-error: true
46-
uses: rojopolis/spellcheck-github-actions@0.40.0
47-
with:
48-
config_path: .spellcheck.yml
49-
task_name: Markdown
50-
output_file: spellcheck-output.txt
51-
52-
- name: Refine spelling results
53-
continue-on-error: true
54-
run: tools/process-spelling.sh
55-
56-
- name: Spelling results
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: spellcheck-output
60-
path: spellcheck-output.txt
61-
retention-days: 5 # Default is 90 days
62-
- name: Scan for profanities
63-
run: |
64-
pip install better_profanity
65-
python tools/profanity.py
66-
cat profanity_log.txt
67-
68-
- name: Export profanities
69-
uses: actions/upload-artifact@v4
70-
with:
71-
name: profanities
72-
path: profanity_log.txt
73-
retention-days: 5
74-
75-
- name: Scan for malware
18+
- name: Legacy Workflow Notice
7619
run: |
77-
tools/install-scan.sh
78-
clamscan -r -i public -l scanlog
79-
80-
- name: Scan results
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: clamscan-log
84-
path: scanlog
85-
retention-days: 5 # Default is 90 days
86-
87-
- name: Azure DevOps Security Scan
88-
uses: actions/setup-dotnet@v4
89-
with:
90-
dotnet-version: |
91-
5.0.x
92-
6.0.x
93-
- name: Run Microsoft Security DevOps
94-
uses: microsoft/security-devops-action@latest
95-
id: msdo
96-
with:
97-
tools: container-mapping, bandit, eslint, templateanalyzer
98-
99-
- name: Upload results to Security tab
100-
uses: actions/upload-artifact@v4
101-
with:
102-
path: ${{ steps.msdo.outputs.sarifFile }}
103-
retention-days: 5 # Default is 90 days
20+
echo "⚠️ This workflow is legacy and has been replaced."
21+
echo ""
22+
echo "Please use the new 'spell-and-link-check.yml' workflow instead."
23+
echo "This workflow contains additional checks (profanity, malware, security)"
24+
echo "that are no longer active in the daily scheduled runs."
25+
echo ""
26+
echo "To run these checks manually, uncomment the specific job below."
27+
exit 0
28+
29+
# Uncomment individual jobs below if you need to run them manually
30+
# check_content:
31+
# runs-on: ubuntu-latest
32+
#
33+
# steps:
34+
# - name: Checkout
35+
# uses: actions/checkout@v4
36+
# with:
37+
# submodules: true
38+
# fetch-depth: 0
39+
#
40+
# - name: Setup Hugo
41+
# uses: peaceiris/actions-hugo@v3
42+
# with:
43+
# hugo-version: '0.130.0'
44+
# extended: true
45+
#
46+
# - name: Build
47+
# run: |
48+
# hugo --minify
49+
# bin/pagefind --site "public"
50+
#
51+
# - name: Check HTML links
52+
# continue-on-error: true
53+
# run: bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log
54+
#
55+
# - name: HTML test results
56+
# uses: actions/upload-artifact@v4
57+
# with:
58+
# name: htmltest-report
59+
# path: htmltest.log
60+
# retention-days: 5
61+
#
62+
# - name: Spell check
63+
# continue-on-error: true
64+
# uses: rojopolis/spellcheck-github-actions@0.40.0
65+
# with:
66+
# config_path: .spellcheck.yml
67+
# task_name: Markdown
68+
# output_file: spellcheck-output.txt
69+
#
70+
# - name: Refine spelling results
71+
# continue-on-error: true
72+
# run: tools/process-spelling.sh
73+
#
74+
# - name: Spelling results
75+
# uses: actions/upload-artifact@v4
76+
# with:
77+
# name: spellcheck-output
78+
# path: spellcheck-output.txt
79+
# retention-days: 5
80+
#
81+
# - name: Scan for profanities
82+
# run: |
83+
# pip install better_profanity
84+
# python tools/profanity.py
85+
# cat profanity_log.txt
86+
#
87+
# - name: Export profanities
88+
# uses: actions/upload-artifact@v4
89+
# with:
90+
# name: profanities
91+
# path: profanity_log.txt
92+
# retention-days: 5
93+
#
94+
# - name: Scan for malware
95+
# run: |
96+
# tools/install-scan.sh
97+
# clamscan -r -i public -l scanlog
98+
#
99+
# - name: Scan results
100+
# uses: actions/upload-artifact@v4
101+
# with:
102+
# name: clamscan-log
103+
# path: scanlog
104+
# retention-days: 5
105+
#
106+
# - name: Azure DevOps Security Scan
107+
# uses: actions/setup-dotnet@v4
108+
# with:
109+
# dotnet-version: |
110+
# 5.0.x
111+
# 6.0.x
112+
#
113+
# - name: Run Microsoft Security DevOps
114+
# uses: microsoft/security-devops-action@latest
115+
# id: msdo
116+
# with:
117+
# tools: container-mapping, bandit, eslint, templateanalyzer
118+
#
119+
# - name: Upload results to Security tab
120+
# uses: actions/upload-artifact@v4
121+
# with:
122+
# path: ${{ steps.msdo.outputs.sarifFile }}
123+
# retention-days: 5
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Spell and Link Check
2+
3+
on:
4+
# Temporary: trigger on push for testing
5+
push:
6+
branches:
7+
- spell-and-link-check
8+
# run once a day at 6AM UTC
9+
schedule:
10+
- cron: '0 6 * * *'
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
jobs:
16+
spell_and_link_check:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: true
24+
fetch-depth: 0
25+
26+
- name: Setup Hugo
27+
uses: peaceiris/actions-hugo@v3
28+
with:
29+
hugo-version: '0.130.0'
30+
extended: true
31+
32+
- name: Build
33+
run: |
34+
hugo --minify
35+
bin/pagefind --site "public"
36+
37+
- name: Check HTML links
38+
id: htmltest
39+
continue-on-error: true
40+
run: |
41+
echo "## HTML Link Check Results" >> $GITHUB_STEP_SUMMARY
42+
echo "" >> $GITHUB_STEP_SUMMARY
43+
bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log
44+
45+
if [ -f htmltest.log ]; then
46+
echo '```' >> $GITHUB_STEP_SUMMARY
47+
# Strip ANSI color codes for cleaner output
48+
sed 's/\x1b\[[0-9;]*m//g' htmltest.log >> $GITHUB_STEP_SUMMARY
49+
echo '```' >> $GITHUB_STEP_SUMMARY
50+
fi
51+
52+
- name: HTML test results artifact
53+
if: always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: htmltest-report
57+
path: htmltest.log
58+
retention-days: 5
59+
60+
- name: Spell check
61+
id: spellcheck
62+
continue-on-error: true
63+
uses: rojopolis/spellcheck-github-actions@0.40.0
64+
with:
65+
config_path: .spellcheck.yml
66+
task_name: Markdown
67+
output_file: spellcheck-output.txt
68+
69+
- name: Refine spelling results
70+
if: always()
71+
continue-on-error: true
72+
run: tools/process-spelling.sh
73+
74+
- name: Display spelling results
75+
if: always()
76+
run: |
77+
echo "## Spell Check Results" >> $GITHUB_STEP_SUMMARY
78+
echo "" >> $GITHUB_STEP_SUMMARY
79+
80+
if [ -f spellcheck-output.txt ]; then
81+
# Count total issues
82+
ISSUE_COUNT=$(grep -c "^" spellcheck-output.txt || echo "0")
83+
echo "**Total spelling issues found:** $ISSUE_COUNT" >> $GITHUB_STEP_SUMMARY
84+
echo "" >> $GITHUB_STEP_SUMMARY
85+
86+
# Show first 100 lines if file is large
87+
LINE_COUNT=$(wc -l < spellcheck-output.txt)
88+
if [ "$LINE_COUNT" -gt 100 ]; then
89+
echo "**Showing first 100 issues (total: $LINE_COUNT):**" >> $GITHUB_STEP_SUMMARY
90+
echo "" >> $GITHUB_STEP_SUMMARY
91+
echo '```' >> $GITHUB_STEP_SUMMARY
92+
head -100 spellcheck-output.txt >> $GITHUB_STEP_SUMMARY
93+
echo '```' >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
echo "See the full report in the spellcheck-output artifact." >> $GITHUB_STEP_SUMMARY
96+
else
97+
echo '```' >> $GITHUB_STEP_SUMMARY
98+
cat spellcheck-output.txt >> $GITHUB_STEP_SUMMARY
99+
echo '```' >> $GITHUB_STEP_SUMMARY
100+
fi
101+
else
102+
echo "No spelling issues found or spell check did not run." >> $GITHUB_STEP_SUMMARY
103+
fi
104+
105+
- name: Spelling results artifact
106+
if: always()
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: spellcheck-output
110+
path: spellcheck-output.txt
111+
retention-days: 5
112+
113+
- name: Summary
114+
if: always()
115+
run: |
116+
echo "" >> $GITHUB_STEP_SUMMARY
117+
echo "---" >> $GITHUB_STEP_SUMMARY
118+
echo "" >> $GITHUB_STEP_SUMMARY
119+
echo "### Check Complete" >> $GITHUB_STEP_SUMMARY
120+
echo "" >> $GITHUB_STEP_SUMMARY
121+
echo "- **HTML Link Check:** $([ -f htmltest.log ] && echo '✓ Complete' || echo '✗ Failed')" >> $GITHUB_STEP_SUMMARY
122+
echo "- **Spell Check:** $([ -f spellcheck-output.txt ] && echo '✓ Complete' || echo '✗ Failed')" >> $GITHUB_STEP_SUMMARY
123+
echo "" >> $GITHUB_STEP_SUMMARY
124+
echo "Download full reports from the artifacts section above." >> $GITHUB_STEP_SUMMARY
125+
# Testing workflow detection

0 commit comments

Comments
 (0)