Skip to content

Commit 8284f94

Browse files
authored
Merge pull request #61 from call-0f-code/github-actions-update
github action updated to support skip test when branch is not main
2 parents 1e5ebcb + 60663ca commit 8284f94

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: Run Tests
22

33
on:
44
pull_request:
5-
branches:
6-
- main
75

86
jobs:
97
test:
8+
if: github.base_ref == 'main'
109
runs-on: ubuntu-latest
1110

1211
steps:
@@ -16,7 +15,7 @@ jobs:
1615
- name: Set up Bun
1716
uses: oven-sh/setup-bun@v2
1817
with:
19-
bun-version: "1.2.18" # or pin to whatever Bun version you need
18+
bun-version: "1.2.18"
2019

2120
- name: Cache Bun dependencies
2221
uses: actions/cache@v4
@@ -36,3 +35,10 @@ jobs:
3635

3736
- name: Run tests
3837
run: bun jest
38+
skip-tests:
39+
if: github.base_ref != 'main'
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Skip tests for non-main PR
44+
run: echo "Tests skipped - PR is not targeting main branch"

0 commit comments

Comments
 (0)