Skip to content

Commit 38deb67

Browse files
authored
Prevent duplicate workflow runs on PRs (#2)
1 parent 28ec32e commit 38deb67

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.github/workflows/build.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Build
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- "main"
67

78
jobs:
89
build:
@@ -15,5 +16,5 @@ jobs:
1516
node-version: 20.x
1617
cache: "npm"
1718
- run: npm ci
18-
- run: npm run build --if-present
19+
- run: npm run build
1920
- run: npm test

.github/workflows/pr.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Setup Node.js
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: 20.x
15+
cache: "npm"
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm test

0 commit comments

Comments
 (0)