File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1818 pull_request :
1919
2020env :
21- HEAD_REF : ${{ github.head_ref }}
2221 REPO_FULL_NAME : ${{ github.event.pull_request.head.repo.full_name }}
22+ GITHUB_REPOSITORY : ${{ github.repository }}
2323
2424jobs :
2525 library_generation :
26- # skip pull requests coming from a forked repository
27- if : github.env.REPO_FULL_NAME == github.repository
2826 runs-on : ubuntu-latest
2927 steps :
28+ - name : Determine whether the pull request comes from a fork
29+ run : |
30+ if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then
31+ echo "This PR comes from a fork. Skip library generation."
32+ echo "SHOULD_RUN=false" >> $GITHUB_ENV
33+ else
34+ echo "SHOULD_RUN=true" >> $GITHUB_ENV
35+ fi
3036 - uses : actions/checkout@v4
37+ if : env.SHOULD_RUN == 'true'
3138 with :
3239 fetch-depth : 0
3340 token : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
3441 - name : Generate changed libraries
42+ if : env.SHOULD_RUN == 'true'
3543 shell : bash
3644 run : |
3745 set -ex
3846 [ -z "$(git config user.email)" ] && git config --global user.email "[email protected] " 3947 [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
4048 bash .github/scripts/hermetic_library_generation.sh \
41- --target_branch ${{ github.base_ref }} \
42- --current_branch $ HEAD_REF
49+ --target_branch "${BASE_REF}" \
50+ --current_branch "${ HEAD_REF}"
4351 env :
52+ BASE_REF : ${{ github.base_ref }}
53+ HEAD_REF : ${{ github.head_ref }}
4454 GH_TOKEN : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
You can’t perform that action at this time.
0 commit comments