Skip to content

Commit 99a2297

Browse files
build: use code-suggester v5 (googleapis#31553)
* build: use code-suggester v5 Unfortunately a manual run of the generation action against https://github.com/googleapis/google-api-java-client-services/pull/31118/changes ended up with googleapis@a7acc0e, which transferred the changes directly. This PR reverts the changes and additionally tries code-suggester v5 * chore: remove comment
1 parent 4daa6d6 commit 99a2297

1 file changed

Lines changed: 14 additions & 42 deletions

File tree

.github/workflows/generate.yaml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,46 +43,18 @@ jobs:
4343
pip install pip==21.3.1
4444
pip --version
4545
- run: ./google-api-java-client-services/.github/workflows/generate.sh ${{ matrix.service }}
46-
- name: Create PR via Local Checkout (Large Commit Support)
47-
shell: bash
48-
working-directory: google-api-java-client-services
46+
- uses: googleapis/code-suggester@v5
4947
env:
50-
GH_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
51-
SERVICE: ${{ matrix.service }}
52-
AUTHOR: "yoshi-code-bot <yoshi-code-bot@google.com>"
53-
BASE_REPO: "${{ github.repository }}"
54-
run: |
55-
set -ex
56-
57-
# 1. Setup Identity
58-
git config user.name "yoshi-code-bot"
59-
git config user.email "yoshi-code-bot@google.com"
60-
61-
# 2. Setup Remote Fork
62-
git remote add fork "https://yoshi-code-bot:${GH_TOKEN}@github.com/yoshi-code-bot/google-api-java-client-services.git"
63-
64-
# 3. Create Branch
65-
BRANCH="regenerate-${SERVICE}"
66-
git checkout -b "$BRANCH"
67-
68-
# 4. Stage specific files (Large commit handling)
69-
TARGET_PATH="clients/google-api-services-${SERVICE}"
70-
git add "$TARGET_PATH"
71-
72-
# 5. Commit & Push
73-
MESSAGE="chore: regenerate ${SERVICE} client"
74-
if git diff-index --quiet HEAD --; then
75-
echo "No changes to commit for ${SERVICE}."
76-
exit 0
77-
fi
78-
79-
git commit -m "$MESSAGE"
80-
git push fork "$BRANCH" --force
81-
82-
gh pr create \
83-
--repo "$BASE_REPO" \
84-
--head "yoshi-code-bot:${BRANCH}" \
85-
--base "main" \
86-
--title "$MESSAGE" \
87-
--body "Generated in GitHub action: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
88-
|| echo "PR already exists or failed to create, but changes are pushed."
48+
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
49+
with:
50+
command: pr
51+
upstream_owner: ${{ github.repository_owner }}
52+
upstream_repo: google-api-java-client-services
53+
description: 'Generated in GitHub action: https://github.com/${{ github.repository_owner }}/${{ github.repository }}/actions/workflows/codegen.yaml'
54+
title: 'chore: regenerate ${{ matrix.service }} client'
55+
message: 'chore: regenerate ${{ matrix.service }} client'
56+
branch: regenerate-${{ matrix.service }}
57+
git_dir: 'google-api-java-client-services/clients/google-api-services-${{ matrix.service }}'
58+
primary: main
59+
force: true
60+
fork: true

0 commit comments

Comments
 (0)