diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index aa355a0..c9a84e7 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -16,10 +16,29 @@ jobs: os: [ubuntu-latest] steps: - - - uses: actions/download-artifact@v2 + - name: 'Download artifact' + uses: actions/github-script@v5 with: - name: pr + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" + })[0]; + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + let fs = require('fs'); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr.zip`, Buffer.from(download.data)); + + - name: 'Unzip artifact' + run: unzip pr.zip - name: id: pr run: pr=$(cat pr);echo "::set-output name=pr::$pr" @@ -62,5 +81,3 @@ jobs: uses: reviewdog/action-flake8@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - -