File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1919 paths :
2020 - ' generation_config.yaml'
2121
22+
23+ env :
24+ HEAD_REF : ${{ github.head_ref }}
25+ REPO_FULL_NAME : ${{ github.event.pull_request.head.repo.full_name }}
26+ GITHUB_REPOSITORY : ${{ github.repository }}
27+
2228jobs :
2329 library_generation :
24- # skip pull requests coming from a forked repository
25- if : github.event.pull_request.head.repo.full_name == github.repository
2630 runs-on : ubuntu-latest
2731 steps :
2832 - uses : actions/checkout@v4
@@ -32,11 +36,15 @@ jobs:
3236 - name : Generate changed libraries
3337 shell : bash
3438 run : |
35- set -x
39+ set -ex
40+ if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then
41+ echo "This PR comes from a fork. Generation will be skipped"
42+ exit 0
43+ fi
3644 [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
3745 [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
3846 bash .github/scripts/hermetic_library_generation.sh \
3947 --target_branch ${{ github.base_ref }} \
40- --current_branch ${{ github.head_ref }}
48+ --current_branch $HEAD_REF
4149 env :
4250 GH_TOKEN : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
You can’t perform that action at this time.
0 commit comments