Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-525: Collapse spelling annotation #205

Merged
merged 17 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
16 changes: 15 additions & 1 deletion .github/actions/spelling/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,24 @@ inputs:
description: Repository with default configuration to use, the default from Check Spelling is ''.
required: false
default: Lombiq/GitHub-Actions@dev
post-comment:
description: Flag for if check-spelling should post comment, the default is 1.
required: false
default: '1'
task:
description: Follow up task for check-spelling, the default is ''.
required: false
default: ''
outputs:
followup:
description: Check Spelling output for followup.
value: ${{ steps.step-check-spelling.outputs.followup }}

runs:
using: "composite"
steps:
- name: Check Spelling
id: step-check-spelling
# v0.0.21
uses: check-spelling/check-spelling@d7cd2973c513e84354f9d6cf50a6417a628a78ce
with:
Expand All @@ -53,6 +66,7 @@ runs:
dictionary_source_prefixes: ${{ inputs.dictionary-source-prefixes }}
experimental_apply_changes_via_bot: 0
extra_dictionaries: ${{ inputs.extra-dictionaries }}
post_comment: 1
post_comment: ${{ inputs.post-comment }}
spell_check_this: ${{ inputs.spell-check-this }}
suppress_push_for_open_pull_request: 1
task: ${{ inputs.task }}
17 changes: 17 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ on:
jobs:
check-spelling:
name: Check Spelling
outputs:
followup: ${{ steps.check-spelling-action.outputs.followup }}
runs-on: ubuntu-22.04
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
Expand All @@ -79,15 +81,30 @@ jobs:
git commit -m 'stub commit -- includes submodules'

- name: Check Spelling
id: check-spelling-action
uses: Lombiq/GitHub-Actions/.github/actions/spelling@dev
with:
dictionary-source-prefixes: ${{ inputs.dictionary-source-prefixes }}
extra-dictionaries: ${{ inputs.extra-dictionaries }}
config: ${{ inputs.config }}
spell-check-this: ${{ inputs.spell-check-this }}
post-comment: 0

- name: Cancel Workflow on Failure
if: failure() && inputs.cancel-workflow-on-failure == 'true'
uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-pr:
name: Comment (PR)
runs-on: ubuntu-22.04
needs: check-spelling
permissions:
pull-requests: write
if: always() && needs.check-spelling.outputs.followup && github.event_name == 'pull_request'
steps:
- name: Comment (PR)
uses: Lombiq/GitHub-Actions/.github/actions/spelling@dev
with:
post-comment: 1
task: ${{ needs.check-spelling.outputs.followup }}