Skip to content

Commit

Permalink
github: fix code cover publish workflow
Browse files Browse the repository at this point in the history
The `upload-artifact` action in code-cover-gen was updated and the download side
no longer works. Switch to using `download-artifact`.
  • Loading branch information
RaduBerinde committed Sep 25, 2024
1 parent c0fa4a9 commit c88c747
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/code-cover-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:


jobs:
# This job downloads the artifacts genearted by the code-cover-gen job and
# This job downloads the artifacts generated by the code-cover-gen job and
# uploads them to a GCS bucket, from where Reviewable can access them.
code-cover-publish:
runs-on: ubuntu-latest
Expand All @@ -16,29 +16,12 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
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 == "cover"
})[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}}/cover.zip', Buffer.from(download.data));
- run: |
mkdir -p cover
unzip cover.zip -d cover
name: cover
path: cover
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
Expand Down

0 comments on commit c88c747

Please sign in to comment.