From 82df95cfa78dd26208159c79b6acd630aa41e688 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Fri, 21 Apr 2023 07:54:17 +0200 Subject: [PATCH] Use workflow download action rather than bash script --- .github/workflows/unit-test-results.yml | 26 ++++++------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/unit-test-results.yml b/.github/workflows/unit-test-results.yml index 20f30aa9f..9ec929fb9 100644 --- a/.github/workflows/unit-test-results.yml +++ b/.github/workflows/unit-test-results.yml @@ -17,26 +17,12 @@ jobs: # it does not yet support downloading from a different workflow # https://github.com/actions/download-artifact/issues/3 - name: Download Artifacts - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - mkdir -p artifacts && cd artifacts - - artifacts_url=${{ github.event.workflow_run.artifacts_url }} - - gh api --paginate $artifacts_url -q '.artifacts[] | select(.name=="unit-test-results" or .name=="Event File") | [.name, .archive_download_url] | @tsv' | while read artifact - do - IFS=$'\t' read name url <<< "$artifact" - gh api $url > "$name.zip" - unzip -d "$name" "$name.zip" - done - - if [ $(ls . | wc -l) -eq 0 ] - then - echo "::error::No artifact with name 'unit-test-results' or 'Event File' exists" - exit 1 - fi - shell: bash + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 + with: + run_id: ${{ github.event.workflow_run.id }} + name: "unit-test-results|Event File" + name_is_regexp: true + path: artifacts - name: Publish unit test results uses: EnricoMi/publish-unit-test-result-action@v2