Skip to content

add comments to successful config #62

add comments to successful config

add comments to successful config #62

Workflow file for this run

name: CSpell Check
on:
issue_comment:
types: [created]
jobs:
spellcheck:
if: github.event.comment.body == '/check-ru' && github.event.issue.pull_request != null
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # ensures the full git history is available
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install CSpell
run: |
npm install -g cspell
npm install -g @cspell/dict-ru_ru
cspell link add @cspell/dict-ru_ru
npm install -g @cspell/dict-en-common-misspellings
cspell link add @cspell/dict-en-common-misspellings
- name: Get PR number
id: pr
run: echo "::set-output name=number::${{ github.event.issue.number }}"
- name: Fetch all added and modified files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: 'space-delimited'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run CSpell on all added and modified files
id: cspell_check
run: |
output=""
for file in ${{ steps.files.outputs.all_added_modified }}; do
echo "Checking $file for spelling errors..."
result=$(cspell "$file" --config cspell.json --show-suggestions)
if [ -n "$result" ]; then
output+="### Errors in $file:\n\\\\n$result\n\\\\n\n"
fi
done
echo "::set-output name=results::${output}"
- name: Post results as a PR comment
if: steps.cspell_check.outputs.results != ''
uses: actions/github-script@v5
with:
script: |

Check failure on line 60 in .github/workflows/spellcheck-ru.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/spellcheck-ru.yml

Invalid workflow file

You have an error in your yaml syntax on line 60
const output = ${{ steps.cspell_check.outputs.results }};
const prNumber = ${{ steps.pr.outputs.number }};
const repoName = context.repo.repo;
const ownerName = context.repo.owner;
github.rest.issues.createComment({
owner: ownerName,
repo: repoName,
issue_number: prNumber,
body: output
});