From 1b5d55b9ca16caebe1ddaeec4772dcbc5bc20923 Mon Sep 17 00:00:00 2001 From: rahulpinto19 Date: Tue, 17 Feb 2026 07:59:34 +0000 Subject: [PATCH] handled space with file name --- .github/workflows/link_checker_workflow.yaml | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/link_checker_workflow.yaml b/.github/workflows/link_checker_workflow.yaml index 2edbb92c6c3..f7948eaa53a 100644 --- a/.github/workflows/link_checker_workflow.yaml +++ b/.github/workflows/link_checker_workflow.yaml @@ -43,10 +43,14 @@ jobs: echo "$CHANGED_FILES" echo "-----------------------------" - # Flatten newlines to spaces for the args list - FILES_FLAT=$(echo "$CHANGED_FILES" | tr '\n' ' ') + # FIX: Wrap filenames in quotes to handle spaces + FILES_QUOTED=$(echo "$CHANGED_FILES" | sed 's/^/"/;s/$/"/' | tr '\n' ' ') - echo "CHECK_FILES=$FILES_FLAT" >> $GITHUB_ENV + # Write to env using EOF pattern + echo "CHECK_FILES<> $GITHUB_ENV + echo "$FILES_QUOTED" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + echo "HAS_CHANGES=true" >> $GITHUB_ENV fi @@ -89,14 +93,12 @@ jobs: - name: Delete comment on success if: steps.lychee-check.outcome == 'success' && steps.find-comment.outputs.comment-id != '' - run: | - gh api \ - --method DELETE \ - -H "Accept: application/vnd.github+json" \ - /repos/${{ github.repository }}/issues/comments/${{ steps.find-comment.outputs.comment-id }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + uses: detomarco/delete-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} + - name: Prepare Report if: env.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure' run: |