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 committed Jan 7, 2023
1 parent 6e3f7c1 commit 24f8a42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
- workflow_dispatch
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
yamllint:
permissions:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

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

jobs:
main:
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 @@ -5,6 +5,10 @@ on: [pull_request]
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

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 24f8a42

Please sign in to comment.