From fedf74a52d793500beba4ce0da8299cd02f278ef Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 5 Jun 2026 09:12:24 -0400 Subject: [PATCH 1/4] chore(.github/workflows): let librarian update workflow also sync new commit to generation_config.yaml --- .../update_librarian_googleapis.yaml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update_librarian_googleapis.yaml b/.github/workflows/update_librarian_googleapis.yaml index 2ac9ed3786f3..8ad4c9807ccd 100644 --- a/.github/workflows/update_librarian_googleapis.yaml +++ b/.github/workflows/update_librarian_googleapis.yaml @@ -68,14 +68,21 @@ jobs: new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit) echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT - - name: Detect Changes To Librarian.yaml - id: detect_librarian + - name: Update generation_config.yaml run: | - git add librarian.yaml + echo "Before update:" + grep "^googleapis_commitish" generation_config.yaml + sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${{ steps.commit.outputs.new_commit }}/" generation_config.yaml + echo "After update:" + grep "^googleapis_commitish" generation_config.yaml + - name: Detect Changes To Configs + id: detect_config + run: | + git add librarian.yaml generation_config.yaml changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "has_changes=false" >> $GITHUB_OUTPUT - echo "No changes in librarian.yaml" + echo "No changes in librarian.yaml or generation_config.yaml" else echo "has_changes=true" >> $GITHUB_OUTPUT fi @@ -110,7 +117,7 @@ jobs: env: PYTHONPATH: ${{ github.workspace }}/sdk-platform-java/hermetic_build/library_generation/owlbot - name: Generate Libraries - if: steps.detect_librarian.outputs.has_changes == 'true' + if: steps.detect_config.outputs.has_changes == 'true' id: generate run: | go run github.com/googleapis/librarian/cmd/librarian@latest generate --all @@ -123,11 +130,11 @@ jobs: echo "has_changes=true" >> $GITHUB_OUTPUT fi - name: Commit and Create PR - if: steps.detect_librarian.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true' + if: steps.detect_config.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true' env: GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}" - PR_BODY: "Updated googleapis commitish in librarian.yaml to https://github.com/googleapis/googleapis/commit/${{ steps.commit.outputs.new_commit }}" + PR_BODY: "Updated googleapis commitish in librarian.yaml and generation_config.yaml to https://github.com/googleapis/googleapis/commit/${{ steps.commit.outputs.new_commit }}" run: | set -x From c164afce84b7aefac4b8279ee0b639ba34f119a2 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 5 Jun 2026 09:12:54 -0400 Subject: [PATCH 2/4] add comment to remove this step once ready to remove hermetic build workflow --- .github/workflows/update_librarian_googleapis.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update_librarian_googleapis.yaml b/.github/workflows/update_librarian_googleapis.yaml index 8ad4c9807ccd..a9887eddb2bf 100644 --- a/.github/workflows/update_librarian_googleapis.yaml +++ b/.github/workflows/update_librarian_googleapis.yaml @@ -68,6 +68,7 @@ jobs: new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit) echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT + # TODO(https://github.com/googleapis/librarian/issues/6220): Remove this step. - name: Update generation_config.yaml run: | echo "Before update:" From b6856dd033d07693bc3f59faed54866ed2a2aa26 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 5 Jun 2026 09:18:04 -0400 Subject: [PATCH 3/4] revert unnecessary changes --- .github/workflows/update_librarian_googleapis.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update_librarian_googleapis.yaml b/.github/workflows/update_librarian_googleapis.yaml index a9887eddb2bf..20f80a2cc74a 100644 --- a/.github/workflows/update_librarian_googleapis.yaml +++ b/.github/workflows/update_librarian_googleapis.yaml @@ -76,14 +76,14 @@ jobs: sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${{ steps.commit.outputs.new_commit }}/" generation_config.yaml echo "After update:" grep "^googleapis_commitish" generation_config.yaml - - name: Detect Changes To Configs - id: detect_config + - name: Detect Changes To Librarian.yaml + id: detect_librarian run: | - git add librarian.yaml generation_config.yaml + git add librarian.yaml changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "has_changes=false" >> $GITHUB_OUTPUT - echo "No changes in librarian.yaml or generation_config.yaml" + echo "No changes in librarian.yaml" else echo "has_changes=true" >> $GITHUB_OUTPUT fi @@ -118,7 +118,7 @@ jobs: env: PYTHONPATH: ${{ github.workspace }}/sdk-platform-java/hermetic_build/library_generation/owlbot - name: Generate Libraries - if: steps.detect_config.outputs.has_changes == 'true' + if: steps.detect_librarian.outputs.has_changes == 'true' id: generate run: | go run github.com/googleapis/librarian/cmd/librarian@latest generate --all @@ -131,7 +131,7 @@ jobs: echo "has_changes=true" >> $GITHUB_OUTPUT fi - name: Commit and Create PR - if: steps.detect_config.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true' + if: steps.detect_librarian.outputs.has_changes == 'true' || steps.generate.outputs.has_changes == 'true' env: GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}" From 9ae0717eb244bc50453f6435762b6dea2909071a Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 5 Jun 2026 09:46:44 -0400 Subject: [PATCH 4/4] update log print for Update generation_config.yaml step --- .github/workflows/update_librarian_googleapis.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/update_librarian_googleapis.yaml b/.github/workflows/update_librarian_googleapis.yaml index 20f80a2cc74a..86505108d024 100644 --- a/.github/workflows/update_librarian_googleapis.yaml +++ b/.github/workflows/update_librarian_googleapis.yaml @@ -71,11 +71,8 @@ jobs: # TODO(https://github.com/googleapis/librarian/issues/6220): Remove this step. - name: Update generation_config.yaml run: | - echo "Before update:" - grep "^googleapis_commitish" generation_config.yaml sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${{ steps.commit.outputs.new_commit }}/" generation_config.yaml - echo "After update:" - grep "^googleapis_commitish" generation_config.yaml + git diff generation_config.yaml - name: Detect Changes To Librarian.yaml id: detect_librarian run: |