Skip to content

Commit

Permalink
concurrency: initial draft
Browse files Browse the repository at this point in the history
Spell checking is expensive.
- If someone adds an additional commit, it will probably invalidate the previous report.
As such, we choose to cancel the earlier run and save CPU cycles for the new run.

Update branch.
- It is unlikely that two people will ask the bot to apply different changes at the same
time, however, it could happen. In general, the bot should do something reasonable as
long as both requests are reasonable (most likely an older one and a newer one).
As such, we choose to queue the later run instead of expecting one of the two to
randomly lose the race and fail.
  • Loading branch information
jsoref committed Aug 2, 2021
1 parent 333138f commit 0127a8b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
pull-requests: read
runs-on: ubuntu-latest
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
# note: If you use only_check_changed_files, you do not want cancel-in-progress
cancel-in-progress: true
steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
Expand Down Expand Up @@ -77,6 +81,9 @@ jobs:
github.event.issue.pull_request &&
contains(github.event.comment.body, '@check-spelling-bot apply')
}}
concurrency:
group: spelling-update-${{ github.event.issue.number }}
cancel-in-progress: false
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 0127a8b

Please sign in to comment.