From ae156cbe7c371e55bccf31de7bb4e324c0f89fc9 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Mon, 22 Jan 2024 18:18:46 +0000 Subject: [PATCH 1/2] fix: make cloud-java-bot the author of new library PR and commits --- .github/workflows/generate_new_client.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate_new_client.yaml b/.github/workflows/generate_new_client.yaml index d263b7b5a90e..398aa2e04206 100644 --- a/.github/workflows/generate_new_client.yaml +++ b/.github/workflows/generate_new_client.yaml @@ -114,8 +114,8 @@ jobs: - name: Push to branch and create PR run: | set -x - [ -z "`git config user.email`" ] && git config --global user.email "${USERNAME:-script}@google.com" - [ -z "`git config user.name`" ] && git config --global user.name "${USERNAME:-script}" + [ -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" # create and push to branch in origin # random_id allows multiple runs of this workflow From 6f263574c6d0b6d7e183bd2057530a9e9f133ce5 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Mon, 22 Jan 2024 18:20:05 +0000 Subject: [PATCH 2/2] use cloud java bot token when adding remote --- .github/workflows/generate_new_client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_new_client.yaml b/.github/workflows/generate_new_client.yaml index 398aa2e04206..b7a359bff757 100644 --- a/.github/workflows/generate_new_client.yaml +++ b/.github/workflows/generate_new_client.yaml @@ -125,7 +125,7 @@ jobs: git add --all commit_message="feat: [${API_SHORTNAME}] new module for ${API_SHORTNAME}" git commit -m "${commit_message}" - git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git + git remote add monorepo https://cloud-java-bot:${GH_TOKEN}@github.com/${{ github.repository }}.git git fetch -q --unshallow monorepo git push -f monorepo "${branch_name}"