Skip to content

Commit a4561cc

Browse files
authored
Merge branch 'main' into feat/add-gemini-md
2 parents 895a561 + 941d18d commit a4561cc

2 files changed

Lines changed: 21 additions & 23 deletions

File tree

.github/workflows/deploy_versioned_docs.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ jobs:
3535
ref: ${{ github.event.release.tag_name }}
3636

3737
- name: Get Version from Release Tag
38-
run: echo "VERSION=${GITHUB_EVENT_RELEASE_TAG_NAME}" >> $GITHUB_ENV
38+
id: get_version
3939
env:
40-
GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
40+
RELEASE_TAG: ${{ github.event.release.tag_name }}
41+
run: echo "VERSION=${RELEASE_TAG}" >> "$GITHUB_OUTPUT"
4142

4243
- name: Setup Hugo
4344
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3
@@ -58,7 +59,7 @@ jobs:
5859
run: hugo --minify
5960
working-directory: .hugo
6061
env:
61-
HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.VERSION }}/
62+
HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.get_version.outputs.VERSION }}/
6263
HUGO_RELATIVEURLS: false
6364

6465
- name: Deploy
@@ -67,9 +68,9 @@ jobs:
6768
github_token: ${{ secrets.GITHUB_TOKEN }}
6869
publish_dir: .hugo/public
6970
publish_branch: versioned-gh-pages
70-
destination_dir: ./${{ env.VERSION }}
71+
destination_dir: ./${{ steps.get_version.outputs.VERSION }}
7172
keep_files: true
72-
commit_message: "deploy: docs for ${{ env.VERSION }}"
73+
commit_message: "deploy: docs for ${{ steps.get_version.outputs.VERSION }}"
7374

7475
- name: Clean Build Directory
7576
run: rm -rf .hugo/public
@@ -89,4 +90,4 @@ jobs:
8990
publish_branch: versioned-gh-pages
9091
keep_files: true
9192
allow_empty_commit: true
92-
commit_message: "deploy: docs to root for ${{ env.VERSION }}"
93+
commit_message: "deploy: docs to root for ${{ steps.get_version.outputs.VERSION }}"

.github/workflows/link_checker.yaml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ permissions:
2020
pull-requests: write
2121
issues: write
2222

23-
2423
jobs:
2524
link-check:
2625
runs-on: ubuntu-latest
@@ -29,6 +28,7 @@ jobs:
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
@@ -65,7 +63,7 @@ jobs:
6563

6664
- name: Link Checker
6765
id: lychee-check
68-
if: env.HAS_CHANGES == 'true'
66+
if: steps.changed-files.outputs.HAS_CHANGES == 'true'
6967
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2
7068
continue-on-error: true
7169
with:
@@ -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
@@ -103,18 +102,16 @@ jobs:
103102
STEPS_FIND_COMMENT_OUTPUTS_COMMENT_ID: ${{ steps.find-comment.outputs.comment-id }}
104103

105104
- name: Prepare Report
106-
if: env.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
105+
if: steps.changed-files.outputs.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
107106
run: |
108107
echo "## Link Resolution Note" > full-report.md
109-
110-
111-
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
112109
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
113110
echo "" >> full-report.md
114111
sed -E '/(Redirect|Redirects per input)/d' lychee-report.md >> full-report.md
115112
116113
- name: Create PR Comment
117-
if: env.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
114+
if: steps.changed-files.outputs.HAS_CHANGES == 'true' && steps.lychee-check.outcome == 'failure'
118115
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
119116
with:
120117
comment-id: ${{ steps.find-comment.outputs.comment-id }}

0 commit comments

Comments
 (0)