Skip to content

temp workaround

temp workaround #2

name: Update Test262 tests
on:
# Trigger at every Sunday UTC noon, or manually.
schedule:
- cron: '0 12 * * 0'
workflow_dispatch:
jobs:
update-test262:
runs-on: ubuntu-24.04
steps:
- name: Checkout WPT repo
uses: actions/checkout@v4
with:
path: wpt
- name: Checkout Test262 repo
uses: actions/checkout@v4
with:
repository: tc39/test262
path: test262-spec
- name: Copy Test262 tests to WPT
run: |
LATEST_SHA=$(git -C test262-spec rev-parse HEAD)
echo "Latest remote Test262 SHA: $LATEST_SHA"
mkdir -p wpt/third_party/test262/test/
mkdir -p wpt/third_party/test262/harness/
rsync -a --delete test262-spec/test/ wpt/third_party/test262/test/
rsync -a --delete test262-spec/harness/ wpt/third_party/test262/harness/
cat <<EOF > wpt/third_party/test262/vendored.toml
[test262]

Check failure on line 32 in .github/workflows/update-test262-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-test262-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 32
source = "https://github.com/tc39/test262"
rev = "${LATEST_SHA}"
EOF
- name: Commit changes
id: commit
continue-on-error: true
run: |
cd wpt
export BRANCH_NAME="$BRANCH_PREFIX-$(date +'%Y%m%d%H%M%S')"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
git config user.name "$GIT_AUTHOR_NAME"
git config user.email "$GIT_AUTHOR_EMAIL"
git checkout -B $BRANCH_NAME
git add third_party/test262/
git commit -m "$COMMIT_TITLE"
env:
GIT_AUTHOR_NAME: "wpt-pr-bot"
GIT_AUTHOR_EMAIL: "[email protected]"
BRANCH_PREFIX: "test262-update"
COMMIT_TITLE: "Update Test262 tests"
- name: Create PR
if: ${{ steps.commit.outcome == 'success' }}
run: |
cd wpt
git push --set-upstream origin $BRANCH_NAME
gh pr create --title "$COMMIT_TITLE" --body "$PR_BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_TITLE: "Update Test262 tests"
PR_BODY: "Scheduled weekly update auto-generated by the '${{ github.workflow }}' workflow."