Skip to content

Commit

Permalink
Use concurrency for GitHub Actions workflow
Browse files Browse the repository at this point in the history
Same as: rubocop/rubocop-rspec#1539

This PR ensures that only the last execution per branch always works, even when pushed multiple times in a row, for example. The older one is canceled.

Refs:
https://docs.github.com/en/actions/using-jobs/using-concurrency https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
  • Loading branch information
ydah authored and bbatsov committed Jan 8, 2023
1 parent 614769e commit d4265e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ast_specs:
name: >-
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/spell_checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Spell Checking

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
codespell:
name: Check spelling of all files with codespell
Expand Down

0 comments on commit d4265e7

Please sign in to comment.