Skip to content

Commit e020bc0

Browse files
authored
ci: use cloud-java-bot for manual runs in librarian check (#13601)
Updates the `librarian_generation_check.yaml` workflow to use `cloud-java-bot` credentials and the `CLOUD_JAVA_BOT_GITHUB_TOKEN` secret when committing and pushing changes. This should resolve Google CLA check failures that occur when the workflow is run manually, which previously used the default `github-actions[bot]` identity. Fixes googleapis/librarian#6568
1 parent f6162e2 commit e020bc0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/librarian_generation_check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ jobs:
9696
fi
9797
- name: Commit and push changes (manual run only)
9898
if: ${{ github.event_name == 'workflow_dispatch' }}
99+
env:
100+
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
99101
run: |
100102
if [ -n "$(git status --porcelain)" ]; then
101-
git config --global user.name 'github-actions[bot]'
102-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
103+
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
104+
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
103105
git add -A
104106
git commit -m "chore: regenerate libraries"
105-
git push
107+
git remote set-url origin https://cloud-java-bot:${GH_TOKEN}@github.com/${{ github.repository }}.git
108+
git push origin HEAD:${{ github.ref }}
106109
else
107110
echo "No changes to commit"
108111
fi

0 commit comments

Comments
 (0)