Skip to content
Open
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
54 changes: 54 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Spell check

# Reports spelling errors on lines added by a pull request, as a summary comment
# plus inline review comments on the flagged lines. Existing spelling errors and
# errors on unchanged lines are not included.

on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
spellcheck:
name: CSpell (advisory)
runs-on: ubuntu-latest
steps:
- name: Check out pull request head
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

# Node 24 is pre-cached on ubuntu-latest, avoiding the download
# incurred by node-version: latest.
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24

# Install only CSpell instead of the site's full dependency tree.
- name: Install CSpell
run: npm install --global cspell@10

- name: Find spelling errors introduced by this PR
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
base=$(git merge-base "$BASE_SHA" HEAD)
# Exit 1 means findings; anything else is an operational error
node dev/check-spelling.mjs --base "$base" --format json \
> "$RUNNER_TEMP/spelling.json" || [ "$?" -eq 1 ]
cat "$RUNNER_TEMP/spelling.json"

- name: Report on the pull request
# Fork PRs get a read-only token; the findings are still in the job log
if: github.event.pull_request.head.repo.full_name == github.repository
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: node dev/post-spelling-review.mjs --findings "$RUNNER_TEMP/spelling.json"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ public/changelog.rss
.amp/portals/

public/technical-changelog.rss

logs/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Now that the base requirements of the project have been satisfied, we can instal
pnpm install
```

Spell checking is not part of the project dependencies. To run it locally: `npx cspell@10 --no-progress --dot '**/*'`

Next, run the development server:

```sh
Expand Down
Loading
Loading