Skip to content

Commit 6f41d07

Browse files
committed
ci: refactor browserstack.yml to avoid repeating if and building
1 parent d00baf9 commit 6f41d07

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/browserstack.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ jobs:
2424
PR: ${{ github.event.number }}
2525
REPO: ${{ github.event.repository.full_name }}
2626

27-
build:
27+
gate:
28+
runs-on: ubuntu-latest
2829
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
30+
steps:
31+
- run: echo The Show Must Go On
32+
33+
build:
34+
needs:
35+
- gate
2936
uses: ./.github/workflows/build.yml
3037

3138
cert:
32-
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
39+
needs:
40+
- gate
3341
uses: panva/.github/.github/workflows/cert-for-browserstack.yml@main
3442
with:
3543
subdomain: jose
@@ -41,7 +49,6 @@ jobs:
4149
needs:
4250
- build
4351
- cert
44-
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
4552
runs-on: ubuntu-latest
4653
strategy:
4754
fail-fast: false

0 commit comments

Comments
 (0)