Skip to content

Commit

Permalink
Use
Browse files Browse the repository at this point in the history
skip-duplicate-actions
 to avoid running same actions multiple times concurrently.
  • Loading branch information
AjayKMehta committed Feb 24, 2025
1 parent f513ab7 commit 39b911b
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,24 @@ permissions:
contents: write

jobs:

pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
concurrent_skipping: same_content_newer

analyze:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,23 @@ concurrency:
cancel-in-progress: true

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
concurrent_skipping: same_content_newer

dependency-review:
if: github.actor != 'dependabot[bot]'
needs: pre_job
if: github.actor != 'dependabot[bot]' && needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,27 @@ on:
description: "The reason for running the workflow"
required: true
default: "Manual run"

name: Semgrep

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
concurrent_skipping: same_content_newer

semgrep:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: Semgrep/CI
runs-on: ubuntu-latest
env:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ concurrency:
cancel-in-progress: true

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
concurrent_skipping: same_content_newer

test:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: test-${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
Expand Down

0 comments on commit 39b911b

Please sign in to comment.