Skip to content

Commit

Permalink
Test report upload minor fixes (#1118)
Browse files Browse the repository at this point in the history
b/290997541
  • Loading branch information
oxve authored Aug 8, 2023
1 parent ef26918 commit 4b0022e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/unit_test_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
permissions: {}
# TODO(b/293508740): Report failed workflow runs back to triggering PR.
# pull-requests: write
if: always()
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
name: Upload Unit Test Reports
steps:
- name: Download Unit Test Results
- name: Download '${{ github.event.workflow_run.name }}' Unit Test Results
# The `download-artifact` action can only access artifacts that were uploaded in the same workflow.
# Since it was not this workflow that uploaded the artifacts we must use rest api to download them.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
Expand All @@ -27,7 +27,11 @@ jobs:
script: |
const name = context.payload.workflow_run.name;
const url = context.payload.workflow_run.html_url;
console.log(`Downloading unit test results for '${name}' (${url}).`);
console.log(`Downloading artifacts from ${url}`)
context.payload.workflow_run.pull_requests.forEach(pr => {
console.log(`Pull request: ${context.payload.repository.html_url}/pull/${pr.number}`);
});
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
Expand Down

0 comments on commit 4b0022e

Please sign in to comment.