Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
206 changes: 113 additions & 93 deletions .github/workflows/content-checks.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,123 @@
name: Check Code Quality
name: Check Code Quality (Legacy - Disabled)

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

# Allows you to run this workflow manually from the Actions tab
# Manual runs only for backward compatibility
workflow_dispatch:

jobs:
check_content:
legacy_notice:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.130.0'
extended: true

- name: Build
run: |
hugo --minify
bin/pagefind --site "public"

- name: Check HTML links
continue-on-error: true
run: bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log

- name: HTML test results
uses: actions/upload-artifact@v4
with:
name: htmltest-report
path: htmltest.log
retention-days: 5 # Default is 90 days

- name: Spell check
continue-on-error: true
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
output_file: spellcheck-output.txt

- name: Refine spelling results
continue-on-error: true
run: tools/process-spelling.sh

- name: Spelling results
uses: actions/upload-artifact@v4
with:
name: spellcheck-output
path: spellcheck-output.txt
retention-days: 5 # Default is 90 days
- name: Scan for profanities
run: |
pip install better_profanity
python tools/profanity.py
cat profanity_log.txt

- name: Export profanities
uses: actions/upload-artifact@v4
with:
name: profanities
path: profanity_log.txt
retention-days: 5

- name: Scan for malware
- name: Legacy Workflow Notice
run: |
tools/install-scan.sh
clamscan -r -i public -l scanlog

- name: Scan results
uses: actions/upload-artifact@v4
with:
name: clamscan-log
path: scanlog
retention-days: 5 # Default is 90 days

- name: Azure DevOps Security Scan
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
5.0.x
6.0.x
- name: Run Microsoft Security DevOps
uses: microsoft/security-devops-action@latest
id: msdo
with:
tools: container-mapping, bandit, eslint, templateanalyzer

- name: Upload results to Security tab
uses: actions/upload-artifact@v4
with:
path: ${{ steps.msdo.outputs.sarifFile }}
retention-days: 5 # Default is 90 days
echo "⚠️ This workflow is legacy and has been replaced."
echo ""
echo "Please use the new 'spell-and-link-check.yml' workflow instead."
echo "This workflow contains additional checks (profanity, malware, security)"
echo "that are no longer active in the daily scheduled runs."
echo ""
echo "To run these checks manually, uncomment the specific job below."
exit 0

# Uncomment individual jobs below if you need to run them manually
# check_content:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# fetch-depth: 0
#
# - name: Setup Hugo
# uses: peaceiris/actions-hugo@v3
# with:
# hugo-version: '0.130.0'
# extended: true
#
# - name: Build
# run: |
# hugo --minify
# bin/pagefind --site "public"
#
# - name: Check HTML links
# continue-on-error: true
# run: bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log
#
# - name: HTML test results
# uses: actions/upload-artifact@v4
# with:
# name: htmltest-report
# path: htmltest.log
# retention-days: 5
#
# - name: Spell check
# continue-on-error: true
# uses: rojopolis/[email protected]
# with:
# config_path: .spellcheck.yml
# task_name: Markdown
# output_file: spellcheck-output.txt
#
# - name: Refine spelling results
# continue-on-error: true
# run: tools/process-spelling.sh
#
# - name: Spelling results
# uses: actions/upload-artifact@v4
# with:
# name: spellcheck-output
# path: spellcheck-output.txt
# retention-days: 5
#
# - name: Scan for profanities
# run: |
# pip install better_profanity
# python tools/profanity.py
# cat profanity_log.txt
#
# - name: Export profanities
# uses: actions/upload-artifact@v4
# with:
# name: profanities
# path: profanity_log.txt
# retention-days: 5
#
# - name: Scan for malware
# run: |
# tools/install-scan.sh
# clamscan -r -i public -l scanlog
#
# - name: Scan results
# uses: actions/upload-artifact@v4
# with:
# name: clamscan-log
# path: scanlog
# retention-days: 5
#
# - name: Azure DevOps Security Scan
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: |
# 5.0.x
# 6.0.x
#
# - name: Run Microsoft Security DevOps
# uses: microsoft/security-devops-action@latest
# id: msdo
# with:
# tools: container-mapping, bandit, eslint, templateanalyzer
#
# - name: Upload results to Security tab
# uses: actions/upload-artifact@v4
# with:
# path: ${{ steps.msdo.outputs.sarifFile }}
# retention-days: 5
121 changes: 121 additions & 0 deletions .github/workflows/spell-and-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Spelling and Hyperlinks Check

on:
# run once a day at 6AM UTC
schedule:
- cron: '0 6 * * *'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
spell_and_link_check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.130.0'
extended: true

- name: Build
run: |
hugo --minify
bin/pagefind --site "public"

- name: Check HTML links
id: htmltest
continue-on-error: true
run: |
echo "## HTML Link Check Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
bin/htmltest -c .htmltest.yml -s 2>&1 | tee htmltest.log

if [ -f htmltest.log ]; then
echo '```' >> $GITHUB_STEP_SUMMARY
# Strip ANSI color codes for cleaner output
sed 's/\x1b\[[0-9;]*m//g' htmltest.log >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi

- name: HTML test results artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: htmltest-report
path: htmltest.log
retention-days: 5

- name: Spell check
id: spellcheck
continue-on-error: true
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
output_file: spellcheck-output.txt

- name: Refine spelling results
if: always()
continue-on-error: true
run: tools/process-spelling.sh

- name: Display spelling results
if: always()
run: |
echo "## Spell Check Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ -f spellcheck-output.txt ]; then
# Count total issues
ISSUE_COUNT=$(grep -c "^" spellcheck-output.txt || echo "0")
echo "**Total spelling issues found:** $ISSUE_COUNT" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Show first 100 lines if file is large
LINE_COUNT=$(wc -l < spellcheck-output.txt)
if [ "$LINE_COUNT" -gt 100 ]; then
echo "**Showing first 100 issues (total: $LINE_COUNT):**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
head -100 spellcheck-output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "See the full report in the spellcheck-output artifact." >> $GITHUB_STEP_SUMMARY
else
echo '```' >> $GITHUB_STEP_SUMMARY
cat spellcheck-output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
else
echo "No spelling issues found or spell check did not run." >> $GITHUB_STEP_SUMMARY
fi

- name: Spelling results artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: spellcheck-output
path: spellcheck-output.txt
retention-days: 5

- name: Summary
if: always()
run: |
echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Check Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **HTML Link Check:** $([ -f htmltest.log ] && echo '✓ Complete' || echo '✗ Failed')" >> $GITHUB_STEP_SUMMARY
echo "- **Spell Check:** $([ -f spellcheck-output.txt ] && echo '✓ Complete' || echo '✗ Failed')" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Download full reports from the artifacts section below." >> $GITHUB_STEP_SUMMARY
# Testing workflow detection
Loading