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 19
19
paths :
20
20
- ' generation_config.yaml'
21
21
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
+
22
28
jobs :
23
29
library_generation :
24
- # skip pull requests coming from a forked repository
25
- if : github.event.pull_request.head.repo.full_name == github.repository
26
30
runs-on : ubuntu-latest
27
31
steps :
28
32
- uses : actions/checkout@v4
@@ -32,11 +36,15 @@ jobs:
32
36
- name : Generate changed libraries
33
37
shell : bash
34
38
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
36
44
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected] "
37
45
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
38
46
bash .github/scripts/hermetic_library_generation.sh \
39
47
--target_branch ${{ github.base_ref }} \
40
- --current_branch ${{ github.head_ref }}
48
+ --current_branch $HEAD_REF
41
49
env :
42
50
GH_TOKEN : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
You can’t perform that action at this time.
0 commit comments