Skip to content

Commit

Permalink
ci: add concurrency option to prevent useless run
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Dec 9, 2023
1 parent c0de97d commit c3375f2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/__generate-dependabot-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/__main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/__pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions .github/workflows/need-fix-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c3375f2

Please sign in to comment.