Skip to content

Commit 3b04d4a

Browse files
committed
build: fix update-wpt workflow
1 parent 5d9b63d commit 3b04d4a

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/update-wpt.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,23 @@ on:
88
inputs:
99
subsystems:
1010
description: Subsystem to run the update for
11-
required: false
12-
default: '["url", "urlpattern", "WebCryptoAPI"]'
11+
required: true
12+
default: all
13+
type: choice
14+
# Reminder to keep this list in sync with the SUBSYSTEM_LIST env variable
15+
options:
16+
- all
17+
- url
18+
- urlpattern
19+
- WebCryptoAPI
1320

1421
permissions:
1522
contents: read
1623

1724
env:
1825
NODE_VERSION: lts/*
26+
# Reminder to keep this list in sync with the workflow dispatch input options
27+
SUBSYSTEM_LIST: '["url", "urlpattern", "WebCryptoAPI"]'
1928

2029
jobs:
2130
wpt-subsystem-update:
@@ -24,15 +33,16 @@ jobs:
2433
strategy:
2534
fail-fast: false
2635
matrix:
27-
subsystem: ${{ fromJSON(github.event.inputs.subsystems || '["url", "urlpattern", "WebCryptoAPI"]') }}
36+
# keep list of subsystems in sync with the options in the workflow dispatch input
37+
subsystem: ${{ (inputs.subsystems == 'all') && fromJSON(env.SUBSYSTEM_LIST) || fromJSON('["' + inputs.subsystems + '"]') }}
2838

2939
steps:
30-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3141
with:
3242
persist-credentials: false
3343

3444
- name: Install Node.js
35-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
45+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
3646
with:
3747
node-version: ${{ env.NODE_VERSION }}
3848

@@ -68,9 +78,11 @@ jobs:
6878
SUBSYSTEM: ${{ matrix.subsystem }}
6979

7080
- name: Open or update PR for the subsystem update
71-
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
81+
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
7282
with:
73-
branch: actions/update-wpt-${{ matrix.subsystem }}
83+
# The action used will match by prefix, which means that url will match urlpattern,
84+
# and update the wrong PR. This is why we need a suffix to differentiate the PRs.
85+
branch: actions/update-${{ matrix.subsystem }}-wpt
7486
author: Node.js GitHub Bot <[email protected]>
7587
title: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'
7688
commit-message: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'

0 commit comments

Comments
 (0)