Skip to content

Commit 090e7e7

Browse files
committed
ci(workflows): avoid duplicate runs on PR pushes; bump actions; move Windows to windows-2022\n\n- Limit push triggers to master; run PR workflows on pull_request only\n- Add concurrency with cancel-in-progress to dedupe per PR/branch\n- Checkout@v4 + fetch-depth: 0 for reliable origin/master refs\n- Setup-node@v4; Windows runner from 2019 -> 2022
1 parent 6e65ef9 commit 090e7e7

2 files changed

Lines changed: 29 additions & 9 deletions

File tree

.github/workflows/node-windows.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
name: Windows
22

33
on:
4+
# Run on all PRs (regardless of base branch)
45
pull_request:
56
types:
6-
- edited
77
- opened
88
- synchronize
9+
- reopened
10+
- ready_for_review
11+
# Run on direct pushes to the default branch only (avoid duplicate runs for PR branches)
912
push:
1013
branches:
11-
- '*'
14+
- master
1215

1316
jobs:
1417
build:
15-
runs-on: windows-2019
18+
runs-on: windows-2022
19+
20+
# Ensure only one run per PR/branch is active; cancel superseded runs on new pushes
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref_name }}
23+
cancel-in-progress: true
1624

1725
strategy:
1826
matrix:
@@ -24,13 +32,15 @@ jobs:
2432
run: git config --global core.autocrlf false
2533

2634
- name: Checkout Commit
27-
uses: actions/checkout@v1
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
2838

2939
- name: Checkout Master
3040
run: git branch -f master origin/master
3141

3242
- name: Setup Node
33-
uses: actions/setup-node@v1
43+
uses: actions/setup-node@v4
3444
with:
3545
node-version: ${{ matrix.node }}
3646

.github/workflows/validate.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
name: Validate
22

33
on:
4+
# Run on all PRs (regardless of base branch)
45
pull_request:
56
types:
6-
- edited
77
- opened
88
- synchronize
9+
- reopened
10+
- ready_for_review
11+
# Run on direct pushes to the default branch only (avoid duplicate runs for PR branches)
912
push:
1013
branches:
11-
- '*'
14+
- master
1215

1316
jobs:
1417
build:
1518
runs-on: ubuntu-latest
1619

20+
# Ensure only one run per PR/branch is active; cancel superseded runs on new pushes
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref_name }}
23+
cancel-in-progress: true
24+
1725
strategy:
1826
matrix:
1927
node: ['20.19.0']
@@ -22,10 +30,12 @@ jobs:
2230

2331
steps:
2432
- name: Checkout Commit
25-
uses: actions/checkout@v1
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
2636

2737
- name: Setup Node
28-
uses: actions/setup-node@v1
38+
uses: actions/setup-node@v4
2939
with:
3040
node-version: ${{ matrix.node }}
3141

0 commit comments

Comments
 (0)