Skip to content

Commit 40fff27

Browse files
committed
Skip pull request job if push job already running
1 parent e541dc7 commit 40fff27

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@ on:
55
pull_request:
66

77
jobs:
8-
setup-test-lint:
9-
name: Setup, Test, and Lint
8+
9+
skip_if_running:
10+
name: Skip job if already running
11+
runs-on: ubuntu-latest
12+
13+
outputs:
14+
skip: ${{ steps.check_skip.outputs.should_skip }}
15+
16+
steps:
17+
- uses: fkirc/skip-duplicate-actions@master
18+
id: check_skip
19+
with:
20+
concurrent_skipping: same_content_newer
21+
do_not_skip: '["push", "workflow_dispatch"]'
22+
23+
all_checks:
24+
name: All checks
1025
runs-on: ubuntu-latest
26+
27+
needs: skip_if_running
28+
if: needs.skip_if_running.outputs.skip != 'true'
29+
1130
steps:
1231
- uses: actions/checkout@v2
1332
- uses: actions/setup-node@v1

0 commit comments

Comments
 (0)