diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index 719eccb8c3b..0ee3ddab7db 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -39,11 +39,30 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: - name: 📥 Download PR Number Artifact - uses: actions/download-artifact@v4 + uses: actions/github-script@v3.1.0 with: - name: pr-number - path: ./ github-token: ${{ env.GH_TOKEN }} + script: | + const artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{ github.event.workflow_run.id }}, + }); + + const matchArtifact = artifacts.data.artifacts.find(artifact => artifact.name === "pr-number"); + if (!matchArtifact) { + throw new Error("Artifact 'pr-number' not found."); + } + + const download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + + const fs = require('fs'); + fs.writeFileSync('${{ github.workspace }}/pr-number.zip', Buffer.from(download.data)); - name: 📦 Extract PR Number Artifact run: unzip pr-number.zip