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
65 changes: 48 additions & 17 deletions .github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 34 additions & 2 deletions .github/workflows/daily-astrostylelite-markdown-spellcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ jobs:
)
| .dictionaries = (
if $dict == "" then
[]
["en", "en-US"]
else
["workflow-dictionary"]
["en", "en-US", "workflow-dictionary"]
end
)' \
docs/.cspell.docs.json > "$RUNTIME_CONFIG_PATH"
Expand Down Expand Up @@ -187,6 +187,38 @@ jobs:
echo "files_checked=$FILES_CHECKED" >> "$GITHUB_OUTPUT"
echo "dictionary_path=$DICTIONARY_PATH_REL" >> "$GITHUB_OUTPUT"

- name: Render spellcheck report to step summary
if: success()
shell: bash
run: |
ARTIFACT_DIR="/tmp/gh-aw/spellcheck"
FINDINGS_COUNT=$(jq -r '.findings' "$ARTIFACT_DIR/summary.json")
FILES_CHECKED=$(jq -r '.files_checked' "$ARTIFACT_DIR/summary.json")
DICT_PATH=$(jq -r '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json")
LOCALE=$(jq -r '.locale' "$ARTIFACT_DIR/summary.json")
Comment on lines +194 to +198
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new step-summary script doesn’t enable strict bash mode. Without set -euo pipefail, a missing/corrupt summary.json or findings.ndjson (or a failed jq invocation) can be silently ignored and still produce a “successful” step with an incomplete/misleading summary. Consider adding set -euo pipefail at the top of this run: block (and optionally use jq -e / defaults like .findings // 0 to make failures explicit).

Suggested change
ARTIFACT_DIR="/tmp/gh-aw/spellcheck"
FINDINGS_COUNT=$(jq -r '.findings' "$ARTIFACT_DIR/summary.json")
FILES_CHECKED=$(jq -r '.files_checked' "$ARTIFACT_DIR/summary.json")
DICT_PATH=$(jq -r '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json")
LOCALE=$(jq -r '.locale' "$ARTIFACT_DIR/summary.json")
set -euo pipefail
ARTIFACT_DIR="/tmp/gh-aw/spellcheck"
FINDINGS_COUNT=$(jq -er '.findings' "$ARTIFACT_DIR/summary.json")
FILES_CHECKED=$(jq -er '.files_checked' "$ARTIFACT_DIR/summary.json")
DICT_PATH=$(jq -er '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json")
LOCALE=$(jq -er '.locale' "$ARTIFACT_DIR/summary.json")

Copilot uses AI. Check for mistakes.

{
echo "## Spellcheck Report"
echo ""
echo "| Metric | Value |"
echo "|--------|-------|"
echo "| Locale | \`$LOCALE\` |"
echo "| Files checked | $FILES_CHECKED |"
echo "| Findings | $FINDINGS_COUNT |"
echo "| Dictionary | $DICT_PATH |"
echo ""
if [ "$FINDINGS_COUNT" -gt 0 ]; then
echo "### Findings"
echo ""
echo "| File | Line | Column | Word | Suggestions |"
echo "|------|------|--------|------|-------------|"
jq -r '. | "\(.file | ltrimstr(env.GITHUB_WORKSPACE) | ltrimstr("/")) | \(.line // "-") | \(.column // "-") | `\(.word)` | \(.suggestions | join(", ")) |"' \
"$ARTIFACT_DIR/findings.ndjson"
else
echo "_No spelling findings._"
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload spellcheck artifact
if: success()
uses: actions/upload-artifact@v7.0.1
Expand Down
Loading