forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.91 KB
/
Copy pathspelling-check-bot.yml
File metadata and controls
65 lines (55 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Create an issue to report typos
on:
schedule:
- cron: "0 0 * * mon"
workflow_dispatch:
permissions:
# Create issue.
issues: write
jobs:
sync:
if: github.repository == 'mdn/content'
runs-on: ubuntu-latest
permissions:
issues: write
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install all yarn packages
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run scripts
id: check
run: |
echo Running spelling check...
output=$(yarn --silent lint:typos-group-by-file || exit 0)
if [ -n "${output}" ]; then
output=$(node scripts/linkify-logs.js "${output}")
output=$(echo "$output" | sed 's/^/- /')
echo "$output"
echo "OUTPUT<<EOF" >> "$GITHUB_OUTPUT"
echo "$output" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
else
echo "No typos found! 🎉"
fi
- name: Report spellcheck errors
if: steps.check.outputs.OUTPUT != ''
run: |
issue=$(gh issue create --title "$TITLE" --label "$LABELS" --body "$BODY")
echo Issue URL ${issue}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TITLE: Weekly spelling check
LABELS: reported by automation
BODY: |
Typos and unknown words:
${{ steps.check.outputs.OUTPUT }}
> [!TIP]
> If the word is actually valid or it is required to be ignored, consider adding it to one of the dictionaries under [`.vscode/dictionaries`](https://github.com/mdn/content/tree/main/.vscode/dictionaries).