From 561333c506b53aec265470d9480b2ba2b6696a47 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Sat, 7 Jan 2023 17:36:29 +0900 Subject: [PATCH] Use concurrency for GitHub Actions workflow Same as: https://github.com/rubocop/rubocop-rspec/pull/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/ --- .github/workflows/linting.yml | 3 +++ .github/workflows/spell_checking.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 3fa1fd4463..0aefc66465 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,6 +1,9 @@ name: Linting on: - pull_request +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: yamllint: name: Yamllint diff --git a/.github/workflows/spell_checking.yml b/.github/workflows/spell_checking.yml index 5b8de89783..c1fd5ef40c 100644 --- a/.github/workflows/spell_checking.yml +++ b/.github/workflows/spell_checking.yml @@ -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