Skip to content

fix: fix spellcheck config to select English dictionaries and render step summary (#daily-astrostylelite-markdown-spellcheck)#28134

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-spellcheck-configuration
Apr 23, 2026
Merged

fix: fix spellcheck config to select English dictionaries and render step summary (#daily-astrostylelite-markdown-spellcheck)#28134
pelikhan merged 2 commits intomainfrom
copilot/fix-spellcheck-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Fixes two issues in the Daily AstroStyleLite Markdown Spellcheck workflow.

Changes

1. Fix English dictionary not being selected

The jq command that builds the runtime cspell config was replacing .dictionaries with [] when no custom dictionary file was found (Selected dictionary: none in the logs). This silently dropped the English built-in dictionaries, causing cspell to run without any language support.

Fix: Always include "en" and "en-US" in the generated .dictionaries list, whether or not a custom dictionary is present.

2. Add spellcheck report to step summary

There was no step writing to $GITHUB_STEP_SUMMARY, so the job produced no visible summary in the Actions UI.

Fix: Added a "Render spellcheck report to step summary" step that writes a markdown report with:

  • Locale, files checked, findings count, dictionary path
  • A findings table (file, line, column, word, suggestions) when findings exist

Both the .md source and the compiled .lock.yml are updated (via make recompile).

…ep summary report

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f6a55314-ca5a-4293-acf7-aa4ec2362cf4

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 23, 2026 16:29
Copilot AI review requested due to automatic review settings April 23, 2026 16:29
Copilot AI requested a review from pelikhan April 23, 2026 16:29
@pelikhan pelikhan merged commit 7ac9dc6 into main Apr 23, 2026
24 of 37 checks passed
@pelikhan pelikhan deleted the copilot/fix-spellcheck-configuration branch April 23, 2026 16:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Smoke CI failed. Please review the logs for details.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Daily AstroStyleLite Markdown Spellcheck workflow to ensure English dictionaries are always enabled for cspell runs and to publish a human-readable spellcheck report in the GitHub Actions step summary.

Changes:

  • Ensure runtime cspell config always includes en and en-US dictionaries (even when no custom dictionary file is found).
  • Add a workflow step that renders spellcheck metrics and (when present) findings into $GITHUB_STEP_SUMMARY.
  • Regenerate the compiled workflow lock file to reflect the source workflow changes.
Show a summary per file
File Description
.github/workflows/daily-astrostylelite-markdown-spellcheck.md Fixes runtime cspell dictionary selection and adds a step-summary report step.
.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml Compiled workflow updated to include the dictionary fix and step-summary reporting step.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines +194 to +198
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")
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.
Comment on lines +1564 to +1568
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")
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.

This step-summary run: block doesn’t enable set -euo pipefail. If jq fails (missing/invalid summary.json, etc.), the step can still succeed and write an incomplete/misleading summary. Add strict bash mode (and optionally jq -e / fallbacks like .findings // 0) so failures are surfaced.

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 // 0' "$ARTIFACT_DIR/summary.json")
FILES_CHECKED=$(jq -er '.files_checked // 0' "$ARTIFACT_DIR/summary.json")
DICT_PATH=$(jq -er '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json")
LOCALE=$(jq -er '.locale // "unknown"' "$ARTIFACT_DIR/summary.json")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants