From a0e9810b47e247f2414d158202003dbca626d1e2 Mon Sep 17 00:00:00 2001 From: Mert Can Altin Date: Tue, 20 Aug 2024 16:05:53 +0300 Subject: [PATCH] tools: add WPT updater --- .github/workflows/update-wpt.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/update-wpt.yml diff --git a/.github/workflows/update-wpt.yml b/.github/workflows/update-wpt.yml new file mode 100644 index 00000000000000..a60125185e1d0b --- /dev/null +++ b/.github/workflows/update-wpt.yml @@ -0,0 +1,42 @@ +name: Update WPT + +on: + workflow_dispatch: + schedule: + # Run once a week at 12:00 AM UTC on Sunday. + - cron: 0 0 * * * + +jobs: + update-wpt: + name: Update WPT + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + persist-credentials: false + - name: Update WPT + run: | + rm -rf test/fixtures/wpt + mkdir test/fixtures/wpt + - name: Clone WPT Repository + uses: actions/checkout@v2 + with: + repository: web-platform-tests/wpt + ref: ${{ github.sha }} + path: test/fixtures/wpt + sparse_checkout: common/ eventsource/ fetch/ interfaces/ mimesniff/ resources/ service-workers/ storage/ websockets/ xhr/ LICENSE.md + - name: Move WPT Files + run: | + rm -rf test/fixtures/wpt/.git + - name: Create Pull Request + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: actions/wpt-update + title: Update WPT + body: Automated update of the WPT + commit-message: 'test: update wpt test'