forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (72 loc) · 2.73 KB
/
update-wpt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: WPT update
on:
schedule:
# Run once a week at 12:00 AM UTC on Sunday.
- cron: 0 0 * * *
workflow_dispatch:
inputs:
subsystems:
description: Subsystem to run the update for
required: false
default: '["url", "WebCryptoAPI"]'
permissions:
contents: read
env:
NODE_VERSION: lts/*
jobs:
wpt-subsystem-update:
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
subsystem: ${{ fromJSON(github.event.inputs.subsystems || '["url", "WebCryptoAPI"]') }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install @node-core/utils
run: npm install -g @node-core/utils
- name: Setup @node-core/utils
run: |
ncu-config set username "$USERNAME"
ncu-config set token "$GH_TOKEN"
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
env:
USERNAME: ${{ secrets.JENKINS_USER }}
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
- name: Update WPT for subsystem ${{ matrix.subsystem }}
run: |
git node wpt "$SUBSYSTEM"
env:
SUBSYSTEM: ${{ matrix.subsystem }}
- name: Retrieve new version commit
run: |
new_version="$(
node -p 'require("./test/fixtures/wpt/versions.json")[process.argv[1]].commit' "$SUBSYSTEM"
)"
{
echo "long_version=$new_version"
echo "short_version=${new_version:0:10}"
} >> "$GITHUB_ENV"
env:
SUBSYSTEM: ${{ matrix.subsystem }}
- name: Open or update PR for the subsystem update
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
with:
branch: actions/update-wpt-${{ matrix.subsystem }}
author: Node.js GitHub Bot <[email protected]>
title: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'
commit-message: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'
labels: test
update-pull-request-title-and-body: true
body: >
This is an automated update of the WPT for ${{ matrix.subsystem }} to
https://github.com/web-platform-tests/wpt/commit/${{ env.long_version }}.
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}