fix tests

This commit is contained in:
William Harrison authored and GitHub committed 2025-03-06 21:04:31 +08:00
1 parent 0fa85478d2
commit 7bece280c8
1 file changed
+6 -12
+6 -12
View File
@@ -24,8 +24,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npm install - run: npm install
@@ -43,15 +41,11 @@ jobs:
- name: Get changed files - name: Get changed files
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/github-script@v6 run: |
with: FILES=$(gh api --jq '[.files[].filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files)
script: | echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV
const { execSync } = require("child_process"); env:
const files = execSync(`git diff --name-only HEAD HEAD~${context.payload.pull_request.commits}`) GH_TOKEN: ${{ github.token }}
.toString()
.split("\n")
.filter(Boolean);
core.exportVariable("CHANGED_FILES", JSON.stringify(files));
- name: Run tests - name: Run tests
run: npx ava tests/*.test.js --timeout=30s run: npx ava tests/*.test.js --timeout=1m