Skip to content

Commit

Permalink
ci/cl: fix to run cancel previous build only on pull request branchs
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Dec 28, 2023
1 parent 4054751 commit 71bea88
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -90,13 +90,6 @@ jobs:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
if: github.ref != 'refs/heads/main'
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
cancel_others: true

- name: Checkout
uses: actions/checkout@main
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
MAKEFLAGS: "-j 2"
jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "src/**"
jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down

0 comments on commit 71bea88

Please sign in to comment.