From 7bece280c86bf90549eefcb58ba64bc2de5b771c Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 6 Mar 2025 21:04:31 +0800 Subject: [PATCH] fix tests --- .github/workflows/ci.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc5bbb110..7a30fd883 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - run: npm install @@ -43,15 +41,11 @@ jobs: - name: Get changed files if: github.event_name == 'pull_request' - uses: actions/github-script@v6 - with: - script: | - const { execSync } = require("child_process"); - const files = execSync(`git diff --name-only HEAD HEAD~${context.payload.pull_request.commits}`) - .toString() - .split("\n") - .filter(Boolean); - core.exportVariable("CHANGED_FILES", JSON.stringify(files)); + run: | + FILES=$(gh api --jq '[.files[].filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files) + echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ github.token }} - name: Run tests - run: npx ava tests/*.test.js --timeout=30s + run: npx ava tests/*.test.js --timeout=1m