Skip to content

Commit 7ac9dc6

Browse files
Copilotpelikhan
andauthored
fix: fix spellcheck config to include English dictionaries and add step summary report (#28134)
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f6a55314-ca5a-4293-acf7-aa4ec2362cf4 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent eb0ea6a commit 7ac9dc6

2 files changed

Lines changed: 82 additions & 19 deletions

File tree

.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml

Lines changed: 48 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-astrostylelite-markdown-spellcheck.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ jobs:
9090
)
9191
| .dictionaries = (
9292
if $dict == "" then
93-
[]
93+
["en", "en-US"]
9494
else
95-
["workflow-dictionary"]
95+
["en", "en-US", "workflow-dictionary"]
9696
end
9797
)' \
9898
docs/.cspell.docs.json > "$RUNTIME_CONFIG_PATH"
@@ -187,6 +187,38 @@ jobs:
187187
echo "files_checked=$FILES_CHECKED" >> "$GITHUB_OUTPUT"
188188
echo "dictionary_path=$DICTIONARY_PATH_REL" >> "$GITHUB_OUTPUT"
189189
190+
- name: Render spellcheck report to step summary
191+
if: success()
192+
shell: bash
193+
run: |
194+
ARTIFACT_DIR="/tmp/gh-aw/spellcheck"
195+
FINDINGS_COUNT=$(jq -r '.findings' "$ARTIFACT_DIR/summary.json")
196+
FILES_CHECKED=$(jq -r '.files_checked' "$ARTIFACT_DIR/summary.json")
197+
DICT_PATH=$(jq -r '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json")
198+
LOCALE=$(jq -r '.locale' "$ARTIFACT_DIR/summary.json")
199+
200+
{
201+
echo "## Spellcheck Report"
202+
echo ""
203+
echo "| Metric | Value |"
204+
echo "|--------|-------|"
205+
echo "| Locale | \`$LOCALE\` |"
206+
echo "| Files checked | $FILES_CHECKED |"
207+
echo "| Findings | $FINDINGS_COUNT |"
208+
echo "| Dictionary | $DICT_PATH |"
209+
echo ""
210+
if [ "$FINDINGS_COUNT" -gt 0 ]; then
211+
echo "### Findings"
212+
echo ""
213+
echo "| File | Line | Column | Word | Suggestions |"
214+
echo "|------|------|--------|------|-------------|"
215+
jq -r '. | "\(.file | ltrimstr(env.GITHUB_WORKSPACE) | ltrimstr("/")) | \(.line // "-") | \(.column // "-") | `\(.word)` | \(.suggestions | join(", ")) |"' \
216+
"$ARTIFACT_DIR/findings.ndjson"
217+
else
218+
echo "_No spelling findings._"
219+
fi
220+
} >> "$GITHUB_STEP_SUMMARY"
221+
190222
- name: Upload spellcheck artifact
191223
if: success()
192224
uses: actions/upload-artifact@v7.0.1

0 commit comments

Comments
 (0)