From 0d6a64e046c3ecbda30d6dcb31e5113a5831ba57 Mon Sep 17 00:00:00 2001 From: Leithen Date: Fri, 8 Nov 2024 12:24:36 -0700 Subject: [PATCH] bump actions/download-artifact from 3 to 4. Fix bug with README.md file failing to download. (#11754) --- .github/workflows/check-urls.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml index 16ede5cf7..7f754daf2 100644 --- a/.github/workflows/check-urls.yml +++ b/.github/workflows/check-urls.yml @@ -86,13 +86,26 @@ jobs: gem install awesome_bot - name: Set output id: set-output - run: echo "FILENAME=$(echo ${{ matrix.file }} | grep -oE '[a-zA-Z0-9_-]+(\.yml|\.md)')" >> "$GITHUB_OUTPUT" + # FILENAME takes the complete file path and strips everything before the final '/' + # FILEPATH replaces all '/' with '-' in the file path since '/' is not allowed in upload artifact name + # Due to a bug in actions/download-artifact, we need to rename README.md to BASE_README.md + run: | + echo "FILENAME=$(echo ${{ matrix.file }} | grep -oE '[a-zA-Z0-9_-]+(\.yml|\.md)')" >> "$GITHUB_OUTPUT" + + file_path="${{ matrix.file }}" + file_path="${file_path//\//-}" + + if [[ "$file_path" == "README.md" ]]; then + file_path="BASE_README.md" + fi + + echo "FILEPATH=${file_path}" >> "$GITHUB_OUTPUT" - name: "Check URLs of file: ${{ matrix.file }}" run: | awesome_bot "${{ matrix.file }}" --allow-redirect --allow-dupe --allow-ssl || true; - uses: actions/upload-artifact@v4 with: - name: ${{ steps.set-output.outputs.FILENAME}} + name: ${{ steps.set-output.outputs.FILEPATH }} path: ${{ github.workspace }}/ab-results-*.json @@ -104,9 +117,8 @@ jobs: - name: Checkout # for having the sources of the local action uses: actions/checkout@v4 # download and unzip the ab-results-*.json generated by job-matrix: check-urls - - uses: actions/download-artifact@v3 - with: - name: ${{ steps.set-output.outputs.FILENAME}} + - name: Download artifacts + uses: actions/download-artifact@v4 - name: Generate Summary Report uses: ./.github/actions/awesomebot-gh-summary-action with: