From e76b828b1c30b51bf0ab17c1216a0edf71bf65d1 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Wed, 25 Sep 2024 13:26:29 -0700 Subject: [PATCH] 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`. --- .github/workflows/code-cover-publish.yaml | 29 +++++------------------ 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/code-cover-publish.yaml b/.github/workflows/code-cover-publish.yaml index ba5f63c034..a965391e69 100644 --- a/.github/workflows/code-cover-publish.yaml +++ b/.github/workflows/code-cover-publish.yaml @@ -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/github-script@v3.1.0 + 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'