Skip to content

Commit

Permalink
chore: restore library generation workflow (#2335)
Browse files Browse the repository at this point in the history
* Revert "chore: add generator version to config (#2334)"

This reverts commit 8142a80.

* add generator version
  • Loading branch information
JoeWang1127 authored Sep 6, 2024
1 parent 8142a80 commit c618969
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
[ -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 }}
2 changes: 1 addition & 1 deletion generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gapic_generator_version: 2.44.0
googleapis_commitish: eb4c1ec02412e65c453ef0bfc4347731e64dcc82
googleapis_commitish: c93b54fa3060c7185f6dc724f0f9ec0c12bc44fc
libraries_bom_version: 26.44.0
template_excludes:
- .gitignore
Expand Down

0 comments on commit c618969

Please sign in to comment.