Skip to content

Commit

Permalink
Use concurrency for GitHub Actions workflow
Browse files Browse the repository at this point in the history
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 5, 2023
1 parent c430668 commit 9196085
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CodeSpell
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
codespell:
name: CodeSpell
Expand Down
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/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- master

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

jobs:
confirm_config_and_documentation:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9196085

Please sign in to comment.