@@ -48,21 +48,26 @@ jobs:
4848 github-token : ${{ secrets.GITHUB_TOKEN }}
4949 script : |
5050 let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
51- owner: context.repo.owner,
52- repo: context.repo.repo,
53- run_id: context.payload.workflow_run.id,
54- })
51+ owner: context.repo.owner,
52+ repo: context.repo.repo,
53+ run_id: context.payload.workflow_run.id,
54+ });
5555 let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
5656 return artifact.name == "context.json"
57- })[0]
57+ })[0];
5858 let download = await github.rest.actions.downloadArtifact({
59- owner: context.repo.owner,
60- repo: context.repo.repo,
61- artifact_id: matchArtifact.id,
62- archive_format: 'zip',
63- })
64- let fs = require('fs');
65- fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/context.zip`, Buffer.from(download.data));
59+ owner: context.repo.owner,
60+ repo: context.repo.repo,
61+ artifact_id: matchArtifact.id,
62+ archive_format: 'zip',
63+ });
64+ const fs = require('fs');
65+ const path = require('path');
66+ const temp = '${{ runner.temp }}/artifacts';
67+ if (!fs.existsSync(temp)){
68+ fs.mkdirSync(temp);
69+ }
70+ fs.writeFileSync(path.join(temp, 'context.zip'), Buffer.from(download.data));
6671
6772 - name : Extract PR Data
6873 run : |
0 commit comments