From c3375f2532c56bce53d2d1c21f85abbc55e87657 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 9 Dec 2023 19:01:07 +0100 Subject: [PATCH] ci: add concurrency option to prevent useless run --- .github/workflows/__generate-dependabot-config.yml | 5 +++++ .github/workflows/__main-ci.yml | 4 ++++ .github/workflows/__pull-request-ci.yml | 4 ++++ .github/workflows/need-fix-to-issue.yml | 5 +++++ .github/workflows/release-actions.md | 4 ++++ .github/workflows/semantic-pull-request.yml | 6 +++++- 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/__generate-dependabot-config.yml b/.github/workflows/__generate-dependabot-config.yml index eb6c252..e574a32 100644 --- a/.github/workflows/__generate-dependabot-config.yml +++ b/.github/workflows/__generate-dependabot-config.yml @@ -4,6 +4,11 @@ on: push: branches: - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: main: uses: ./.github/workflows/generate-dependabot-config.yml diff --git a/.github/workflows/__main-ci.yml b/.github/workflows/__main-ci.yml index 5db7e3b..e18e4b5 100644 --- a/.github/workflows/__main-ci.yml +++ b/.github/workflows/__main-ci.yml @@ -6,6 +6,10 @@ on: tags: ["*"] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: ci: uses: ./.github/workflows/__shared-ci.yml diff --git a/.github/workflows/__pull-request-ci.yml b/.github/workflows/__pull-request-ci.yml index 74b4e36..c208f47 100644 --- a/.github/workflows/__pull-request-ci.yml +++ b/.github/workflows/__pull-request-ci.yml @@ -5,6 +5,10 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: ci: uses: ./.github/workflows/__shared-ci.yml diff --git a/.github/workflows/need-fix-to-issue.yml b/.github/workflows/need-fix-to-issue.yml index dc2b3c2..16a2e69 100644 --- a/.github/workflows/need-fix-to-issue.yml +++ b/.github/workflows/need-fix-to-issue.yml @@ -31,6 +31,11 @@ on: description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here" type: string required: false + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: need-fix-to-issue: runs-on: ${{ inputs.runs-on && fromJson(inputs.runs-on) || 'ubuntu-latest' }} diff --git a/.github/workflows/release-actions.md b/.github/workflows/release-actions.md index 0dc0c18..73f902e 100644 --- a/.github/workflows/release-actions.md +++ b/.github/workflows/release-actions.md @@ -27,6 +27,10 @@ on: branches: [main] tags: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: release: uses: hoverkraft-tech/ci-github-common/.github/workflows/release-actions.yml@0.11.1 diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index c2131ed..095dd0c 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -15,7 +15,7 @@ on: - synchronize workflow_call: - inputs: + inputs: runs-on: description: "The type of machine to run on. Default: ubuntu-latest" required: false @@ -30,6 +30,10 @@ permissions: contents: write pull-requests: write +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: lint: name: Validate PR title