From 4b0e55abda3be870f17f35c6dc5db92db61c44d4 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 19 Jan 2024 17:23:22 -0800 Subject: [PATCH] devops: make sure uploaded reports always contain directory (#29080) * Before the change if if uploaded artifact path contained just one file it would be [archived directly](https://github.com/actions/upload-artifact/blob/694cdabd8bdb0f10b2cea11669e1bf5453eed0a6/src/search.ts#L142-L151), but if there is a sister folder it would be an archive of the entire dir. According to the action docs "If a wildcard pattern is used, the path hierarchy will be preserved after the first wildcard pattern", so hopefully it means that the directory is always compressed even if there is a single file in it. * Use `overwrite: true` to have only one artifact with pull request number. --- .github/actions/upload-blob-report/action.yml | 7 ++++--- .github/workflows/create_test_report.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/upload-blob-report/action.yml b/.github/actions/upload-blob-report/action.yml index 20347c11d5..7cb86716d9 100644 --- a/.github/actions/upload-blob-report/action.yml +++ b/.github/actions/upload-blob-report/action.yml @@ -19,7 +19,7 @@ runs: uses: actions/upload-artifact@v4 with: name: blob-report-${{ inputs.job_name }} - path: ${{ inputs.report_dir }} + path: ${{ inputs.report_dir }}/** retention-days: 7 - name: Write triggering pull request number in a file if: always() && github.event_name == 'pull_request' @@ -29,5 +29,6 @@ runs: if: always() && github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: - name: pull-request-${{ inputs.job_name }} - path: pull_request_number.txt \ No newline at end of file + name: pull-request-number + path: pull_request_number.txt + overwrite: true \ No newline at end of file diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index 58a6d3f155..94ca4b7e87 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -49,7 +49,7 @@ jobs: - name: Read pull request number uses: ./.github/actions/download-artifact with: - namePrefix: 'pull-request' + namePrefix: 'pull-request-number' path: '.' - name: Comment on PR