-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: fix code cover publish workflow
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
1 parent
c0fa4a9
commit c88c747
Showing
1 changed file
with
6 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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' | ||
|