mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Codex Test Sync
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled, opened]
|
|
|
|
env:
|
|
BUN_VERSION: "canary"
|
|
|
|
jobs:
|
|
sync-node-tests:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
(github.event.action == 'labeled' && github.event.label.name == 'codex') ||
|
|
(github.event.action == 'opened' && contains(github.event.pull_request.labels.*.name, 'codex'))
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Bun
|
|
uses: ./.github/actions/setup-bun
|
|
with:
|
|
bun-version: ${{ env.BUN_VERSION }}
|
|
|
|
- name: Get changed files and sync tests
|
|
run: |
|
|
# Get the list of changed files from the PR
|
|
git diff --name-only origin/main...HEAD | while read -r file; do
|
|
if [[ "$file" =~ ^test/js/node/test/(parallel|sequential)/(.+)\.js$ ]]; then
|
|
test_name="${BASH_REMATCH[2]}"
|
|
echo "Syncing test: $test_name"
|
|
bun node:test:cp "$test_name"
|
|
fi
|
|
done
|
|
|
|
- name: Commit changes
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
with:
|
|
commit_message: "Sync Node.js tests with upstream"
|