Skip to content

Commit 1680fe7

Browse files
Test on all branches
1 parent 8b68bab commit 1680fe7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
on:
22
push:
3-
branches: main
3+
branches:
4+
- '**' # Run on all branches
45

56
jobs:
6-
publish:
7+
test:
78
runs-on: ubuntu-latest
89
steps:
910
- uses: actions/checkout@v4
@@ -12,6 +13,17 @@ jobs:
1213
node-version: 'latest'
1314
- run: npm ci
1415
- run: npm test
16+
17+
publish:
18+
needs: test
19+
if: github.ref == 'refs/heads/main' # Only run this job on main branch
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 'latest'
26+
- run: npm ci
1527
- uses: JS-DevTools/npm-publish@v3
1628
with:
1729
token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)