Files
servo/.github/workflows/upstream-wpt-changes.yml
Martin Robinson a18baf6719 Fix upstreaming of WPT changes
The GitHub Action needs access to Servo repository secrets, so switch to
using the 'pull_request_target' event. Since these PRs have more
complete access to the Servo repository, do not execute the version of
the upstream script that comes with the PR. Instead, simply fetch the
changes. To make this work, the script no longer expects the PR commit
to be checked out, merely that they exist in the repository somewhere.
2023-01-25 12:17:59 +01:00

34 lines
1.2 KiB
YAML

name: WPT export
on:
pull_request_target:
types: ['opened', 'synchronize', 'reopened', 'edited', 'closed']
jobs:
upstream:
runs-on: ubuntu-latest
steps:
- name: Calculate PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- name: Check out shallow servo PR
run: |
mkdir servo
cd servo
git init -b main
git remote add origin ${{ github.event.repository.clone_url}}
git fetch origin pull/${{ github.event.pull_request.number}}/head:pr --depth ${{ env.PR_FETCH_DEPTH }}
git fetch origin master:master --depth 1
git checkout master
- name: Check out wpt
uses: actions/checkout@v3
with:
path: wpt
repository: 'web-platform-tests/wpt'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install requirements
run: pip install -r servo/etc/ci/upstream-wpt-changes/requirements.txt
- name: Process pull request
run: servo/etc/ci/upstream-wpt-changes/upstream-wpt-changes.py
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }}