Skip to content

Commit 9f0cf6e

Browse files
committed
refactor: add custom spellcheck action
1 parent 3723934 commit 9f0cf6e

File tree

2 files changed

+8
-195
lines changed

2 files changed

+8
-195
lines changed

.github/scripts/spell_check.py

Lines changed: 0 additions & 171 deletions
This file was deleted.

.github/workflows/spell_check.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,15 @@ jobs:
2222
files: |
2323
content/blog/**.md
2424
25-
- name: Set up Python
26-
uses: actions/setup-python@v4
25+
- name: Run Spell Check Action
26+
uses: infraspecdev/spellcheck-action@v1.0.1
2727
with:
28-
python-version: '3.x'
29-
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install openai==0.28
34-
35-
- name: Run spell check
36-
id: spellcheck
37-
env:
38-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
39-
run: |
40-
ALL_CHANGED_FILES='${{ steps.changed-files.outputs.all_changed_files }}'
41-
python .github/scripts/spell_check.py $ALL_CHANGED_FILES
42-
continue-on-error: true
43-
44-
- name: Post comment for pull request
45-
if: github.event_name == 'pull_request'
46-
uses: mshick/add-pr-comment@v2
47-
with:
48-
message-path: spell_check_result_with_lines.json
28+
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
github_repository: ${{ github.repository }}
31+
pr_number: ${{ github.event.number }}
32+
files: ${{ steps.changed-files.outputs.all_changed_files }}
4933

5034
- name: Fail the job if spell check failed
51-
if: steps.spellcheck.outcome == 'failure'
35+
if: failure()
5236
run: exit 1

0 commit comments

Comments
 (0)