Skip to content

Commit 5f977fc

Browse files
authored
chore(.github/workflows): let librarian update workflow also sync new commit to generation_config.yaml (#13372)
Add this step temporarily so that this workflow also triggers hermetic build generation workflow, and we can verify changes in the same PR. This change is intended to be set till 06/10/2026 to verify librarian generate against hermetic build. Here is the sequence: - nightly, this scheduled workflow updates librarian.yaml with new googleapis commit. - [additional step] update generation_config.yaml with same commit. - run `librarian generate -all` and add code change to commit - raise PR. - hermetic build [generation workflow](https://github.com/googleapis/google-cloud-java/blob/main/.github/workflows/hermetic_library_generation.yaml) triggered because generation_config.yaml `googleapis_commitish` is updated. On the next day, we verify the results on this PR, expect hermetic build [generation workflow] runs succesfully with no code change added. If any, we should investigate the diff. Note: hermetic build workflow will not trigger on this PR, because I pushed from fork. This is to avoid it adding code changes to this PR.
1 parent 5959c02 commit 5f977fc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/update_librarian_googleapis.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ jobs:
6868
new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.googleapis.commit)
6969
echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT
7070
echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT
71+
# TODO(https://github.com/googleapis/librarian/issues/6220): Remove this step.
72+
- name: Update generation_config.yaml
73+
run: |
74+
sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${{ steps.commit.outputs.new_commit }}/" generation_config.yaml
75+
git diff generation_config.yaml
7176
- name: Detect Changes To Librarian.yaml
7277
id: detect_librarian
7378
run: |
@@ -127,7 +132,7 @@ jobs:
127132
env:
128133
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
129134
PR_TITLE: "chore: update googleapis commitish to ${{ steps.commit.outputs.short_commit }}"
130-
PR_BODY: "Updated googleapis commitish in librarian.yaml to https://github.com/googleapis/googleapis/commit/${{ steps.commit.outputs.new_commit }}"
135+
PR_BODY: "Updated googleapis commitish in librarian.yaml and generation_config.yaml to https://github.com/googleapis/googleapis/commit/${{ steps.commit.outputs.new_commit }}"
131136
run: |
132137
set -x
133138

0 commit comments

Comments
 (0)