From 80ebb77c6d073bb09195eac9b7a96516c25c86b8 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:41:24 -0400 Subject: [PATCH 1/2] Revert "chore: add generator version to config (#2334)" This reverts commit 8142a80b2db44cd1627a0fa47e0e9fafc8c36c94. --- .../hermetic_library_generation.yaml | 34 ++++++++++++++----- generation_config.yaml | 3 +- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index a7f7f42f59..51a087f8e5 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -17,13 +17,31 @@ name: Hermetic library generation upon generation config change through pull req on: pull_request: +env: + HEAD_REF: ${{ github.head_ref }} + REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} + GITHUB_REPOSITORY: ${{ github.repository }} + jobs: library_generation: - uses: googleapis/google-cloud-java/.github/workflows/reusable_library_generation.yaml@chore/setup-reusable-workflow - with: - repo_full_name: ${{ github.event.pull_request.head.repo.full_name }} - repository: ${{ github.repository }} - base_ref: ${{ github.base_ref }} - head_ref: ${{ github.head_ref }} - secrets: - token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Generate changed libraries + shell: bash + run: | + set -ex + if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then + echo "This PR comes from a fork. Generation will be skipped" + exit 0 + fi + [ -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" + bash .github/scripts/hermetic_library_generation.sh \ + --target_branch ${{ github.base_ref }} \ + --current_branch $HEAD_REF + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/generation_config.yaml b/generation_config.yaml index e5c30181ef..438ec80087 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,4 @@ -gapic_generator_version: 2.44.0 -googleapis_commitish: eb4c1ec02412e65c453ef0bfc4347731e64dcc82 +googleapis_commitish: c93b54fa3060c7185f6dc724f0f9ec0c12bc44fc libraries_bom_version: 26.44.0 template_excludes: - .gitignore From a0da30c8436d83c9538a7a3e38f565cb635c59c0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 6 Sep 2024 08:43:31 -0400 Subject: [PATCH 2/2] add generator version --- generation_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/generation_config.yaml b/generation_config.yaml index 438ec80087..9588be28db 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,3 +1,4 @@ +gapic_generator_version: 2.44.0 googleapis_commitish: c93b54fa3060c7185f6dc724f0f9ec0c12bc44fc libraries_bom_version: 26.44.0 template_excludes: