Skip to content

Commit c618969

Browse files
authored
chore: restore library generation workflow (#2335)
* Revert "chore: add generator version to config (#2334)" This reverts commit 8142a80. * add generator version
1 parent 8142a80 commit c618969

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

.github/workflows/hermetic_library_generation.yaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,31 @@ name: Hermetic library generation upon generation config change through pull req
1717
on:
1818
pull_request:
1919

20+
env:
21+
HEAD_REF: ${{ github.head_ref }}
22+
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
23+
GITHUB_REPOSITORY: ${{ github.repository }}
24+
2025
jobs:
2126
library_generation:
22-
uses: googleapis/google-cloud-java/.github/workflows/reusable_library_generation.yaml@chore/setup-reusable-workflow
23-
with:
24-
repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
25-
repository: ${{ github.repository }}
26-
base_ref: ${{ github.base_ref }}
27-
head_ref: ${{ github.head_ref }}
28-
secrets:
29-
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
33+
- name: Generate changed libraries
34+
shell: bash
35+
run: |
36+
set -ex
37+
if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then
38+
echo "This PR comes from a fork. Generation will be skipped"
39+
exit 0
40+
fi
41+
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]"
42+
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
43+
bash .github/scripts/hermetic_library_generation.sh \
44+
--target_branch ${{ github.base_ref }} \
45+
--current_branch $HEAD_REF
46+
env:
47+
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

generation_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
gapic_generator_version: 2.44.0
2-
googleapis_commitish: eb4c1ec02412e65c453ef0bfc4347731e64dcc82
2+
googleapis_commitish: c93b54fa3060c7185f6dc724f0f9ec0c12bc44fc
33
libraries_bom_version: 26.44.0
44
template_excludes:
55
- .gitignore

0 commit comments

Comments
 (0)