From 9196085abb8c5162335d34e50fcc5870336fe901 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:48:31 +0900 Subject: [PATCH] Use concurrency for GitHub Actions workflow 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/codespell.yml | 3 +++ .github/workflows/linting.yml | 3 +++ .github/workflows/main.yml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7259049ba..e9dc06b17 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -1,6 +1,9 @@ name: CodeSpell on: - pull_request +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: codespell: name: CodeSpell diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 057753096..0256c185f 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/main.yml b/.github/workflows/main.yml index ee75d9fb6..f4d986829 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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