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 05be11b commit 3e00a15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Linting
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
yamllint:
name: Yamllint
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 3e00a15

Please sign in to comment.