GH sucks
This commit is contained in:
parent
2302f2ab53
commit
32fc75a2b7
27
.github/workflows/CI.yaml
vendored
27
.github/workflows/CI.yaml
vendored
@ -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 }}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user