This commit is contained in:
lordwelch 2022-01-16 19:37:26 -08:00
parent 2302f2ab53
commit 32fc75a2b7

View File

@ -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 }}