Skip to content

Commit 625ec8b

Browse files
author
Mert Can Altin
committed
tools: add WPT updater
1 parent 821ffab commit 625ec8b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/update-wpt.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update WPT
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Run once a week at 12:00 AM UTC on Sunday.
7+
- cron: 0 0 * * *
8+
9+
jobs:
10+
update-wpt:
11+
name: Update WPT
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
19+
with:
20+
persist-credentials: false
21+
sparse-checkout: |
22+
!test/fixtures/wpt
23+
- name: Clone WPT Repository
24+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
25+
with:
26+
repository: web-platform-tests/wpt
27+
path: test/fixtures/wpt
28+
sparse_checkout: common/ eventsource/ fetch/ interfaces/ mimesniff/ resources/ service-workers/ storage/ websockets/ xhr/ LICENSE.md
29+
persist-credentials: false
30+
- name: Move WPT Files
31+
run: |
32+
rm -rf test/fixtures/wpt/.git
33+
echo "NEW_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
34+
- name: Create Pull Request
35+
uses: gr2m/create-or-update-pull-request-action@86ec1766034c8173518f61d2075cc2a173fb8c97 # v1.9.4
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
38+
with:
39+
author: Node.js GitHub Bot <[email protected]>
40+
body: This is an automated update of the WPT to ${{ env.NEW_VERSION }}.
41+
branch: actions/update-wpt # Custom branch *just* for this Action.
42+
commit-message: 'test: update WPT to ${{ env.NEW_VERSION }}'
43+
labels: test
44+
title: 'test: update WPT to ${{ env.NEW_VERSION }}'
45+
update-pull-request-title-and-body: true

0 commit comments

Comments
 (0)