Skip to content

Commit

Permalink
Use upload/download-artifact@v4.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Apr 19, 2024
1 parent e06ce32 commit f0a50bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
25 changes: 4 additions & 21 deletions .github/workflows/coverage-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,11 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download Coverage Report
uses: actions/[email protected]
uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "coverage"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/coverage.zip', Buffer.from(download.data));
- run: |
unzip coverage.zip
cat coverage.json
github-token: ${{ secrets.GITHUB_TOKEN }}
name: coverage
run-id: ${{ github.event.workflow_run.id }}

- name: 'Comment on PR'
uses: actions/github-script@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-gather.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
"percent":$percent
}
EOL
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.json

0 comments on commit f0a50bf

Please sign in to comment.