@@ -20,7 +20,6 @@ permissions:
2020 pull-requests : write
2121 issues : write
2222
23-
2423jobs :
2524 link-check :
2625 runs-on : ubuntu-latest
2928 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3029 with :
3130 fetch-depth : 0
31+
3232 - name : Identify Changed Files
3333 id : changed-files
3434 shell : bash
@@ -38,25 +38,23 @@ jobs:
3838
3939 if [ -z "$CHANGED_FILES" ]; then
4040 echo "No markdown files changed. Skipping checks."
41- echo "HAS_CHANGES=false" >> $GITHUB_ENV
41+ echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT"
4242 else
4343 echo "--- Changed Files to Scan ---"
4444 echo "$CHANGED_FILES"
4545 echo "-----------------------------"
4646
47- # FIX: Wrap filenames in quotes to handle spaces
4847 FILES_QUOTED=$(echo "$CHANGED_FILES" | sed 's/^/"/;s/$/"/' | tr '\n' ' ')
4948
50- # Write to env using EOF pattern
51- echo "CHECK_FILES<<EOF " >> $GITHUB_ENV
52- echo "$FILES_QUOTED " >> $GITHUB_ENV
53- echo "EOF " >> $GITHUB_ENV
54- echo "HAS_CHANGES=true " >> $GITHUB_ENV
49+ # Use EOF to write multiline or long strings to GITHUB_OUTPUT
50+ echo "HAS_CHANGES=true " >> "$GITHUB_OUTPUT"
51+ echo "CHECK_FILES<<EOF " >> "$GITHUB_OUTPUT"
52+ echo "$FILES_QUOTED " >> "$GITHUB_OUTPUT"
53+ echo "EOF " >> "$GITHUB_OUTPUT"
5554 fi
5655
57-
5856 - name : Restore lychee cache
59- if : env .HAS_CHANGES == 'true'
57+ if : steps.changed-files.outputs .HAS_CHANGES == 'true'
6058 uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
6159 with :
6260 path : .lycheecache
6563
6664 - name : Link Checker
6765 id : lychee-check
68- if : env .HAS_CHANGES == 'true'
69- uses : lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2
66+ if : steps.changed-files.outputs .HAS_CHANGES == 'true'
67+ uses : lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
7068 continue-on-error : true
7169 with :
7270 args : >
@@ -75,14 +73,15 @@ jobs:
7573 --cache
7674 --max-cache-age 1d
7775 --exclude '^neo4j\+.*' --exclude '^bolt://.*'
78- ${{ env .CHECK_FILES }}
76+ ${{ steps.changed-files.outputs .CHECK_FILES }}
7977 output : lychee-report.md
8078 format : markdown
8179 fail : true
8280 jobSummary : false
8381 debug : false
8482 env :
8583 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84+
8685 - name : Find comment
8786 uses : peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4
8887 id : find-comment
@@ -97,23 +96,22 @@ jobs:
9796 gh api \
9897 --method DELETE \
9998 -H "Accept: application/vnd.github+json" \
100- /repos/${{ github.repository }}/issues/comments/${{ steps.find-comment.outputs.comment-id } }
99+ /repos/${{ github.repository }}/issues/comments/${STEPS_FIND_COMMENT_OUTPUTS_COMMENT_ID }
101100 env :
102101 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102+ STEPS_FIND_COMMENT_OUTPUTS_COMMENT_ID : ${{ steps.find-comment.outputs.comment-id }}
103103
104104 - name : Prepare Report
105- if : env .HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
105+ if : steps.changed-files.outputs .HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
106106 run : |
107107 echo "## Link Resolution Note" > full-report.md
108-
109-
110- echo "Local links and directory changes work differently on GitHub than on the docsite.You must ensure fixes pass the **GitHub check** and also work with **\`hugo server\`**." >> full-report.md
108+ echo "Local links and directory changes work differently on GitHub than on the docsite. You must ensure fixes pass the **GitHub check** and also work with **\`hugo server\`**." >> full-report.md
111109 echo "See [Link Checking and Fixing with Lychee](https://github.com/googleapis/genai-toolbox/blob/main/DEVELOPER.md#link-checking-and-fixing-with-lychee) for more details." >> full-report.md
112110 echo "" >> full-report.md
113111 sed -E '/(Redirect|Redirects per input)/d' lychee-report.md >> full-report.md
114112
115113 - name : Create PR Comment
116- if : env .HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
114+ if : steps.changed-files.outputs .HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
117115 uses : peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
118116 with :
119117 comment-id : ${{ steps.find-comment.outputs.comment-id }}
0 commit comments