From 9e67c3af3a4b41a4c14bb5e36ef3d3cf751b4940 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Tue, 30 Jun 2026 15:24:34 -0400 Subject: [PATCH] ci: use cloud-java-bot for manual runs in librarian check --- .github/workflows/librarian_generation_check.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/librarian_generation_check.yaml b/.github/workflows/librarian_generation_check.yaml index c36eaf1fdc4c..90997623e26b 100644 --- a/.github/workflows/librarian_generation_check.yaml +++ b/.github/workflows/librarian_generation_check.yaml @@ -96,13 +96,16 @@ jobs: fi - name: Commit and push changes (manual run only) if: ${{ github.event_name == 'workflow_dispatch' }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} run: | if [ -n "$(git status --porcelain)" ]; then - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" git add -A git commit -m "chore: regenerate libraries" - git push + git remote set-url origin https://cloud-java-bot:${GH_TOKEN}@github.com/${{ github.repository }}.git + git push origin HEAD:${{ github.ref }} else echo "No changes to commit" fi