Skip to content

Commit c897caa

Browse files
committed
workflows/main: comment on PR instead of failing on spelling errors
1 parent 1a3cd91 commit c897caa

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/main.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
if: github.repository_owner == 'Qiskit'
1515
name: Build, rustfmt, and python lint
1616
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: write
1719
steps:
1820
- name: Print Concurrency Group
1921
env:
@@ -43,7 +45,24 @@ jobs:
4345
- name: Check stray release notes
4446
run: python tools/find_stray_release_notes.py
4547
- name: Spell check
46-
run: typos --exclude releasenotes/ && typos --no-check-filenames releasenotes/
48+
id: spell-check
49+
run: |
50+
status=0
51+
echo '### :warning: Spell check failed' > spell-check-output
52+
typos --exclude releasenotes/ --format brief >> spell-check-output || status=$?
53+
typos --no-check-filenames releasenotes/ --format brief >> spell-check-output || status=$?
54+
if [[ ${status} -ne 0 ]]; then
55+
echo "failed=true" >> ${GITHUB_OUTPUT}
56+
exit 0
57+
fi
58+
exit ${status}
59+
- name: Spell check comment
60+
uses: thollander/actions-comment-pull-request@v3
61+
if: ${{ github.event_name == 'pull_request' }}
62+
with:
63+
comment-tag: spell-check-failed
64+
file-path: spell-check-output
65+
mode: ${{ steps.spell-check.outputs.failed == 'true' && 'upsert' || 'delete' }}
4766
- name: rustworkx-core Rust Tests
4867
run: pushd rustworkx-core && cargo test && popd
4968
- name: rustworkx-core Docs

0 commit comments

Comments
 (0)