From 41e6b84db4270f4b62bccc4a34723a8cc67a30f7 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Sat, 7 Jan 2023 17:52:48 +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 3fa1fd44..0aefc664 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 5b8de897..c1fd5ef4 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