55 pull_request_target :
66 types : [opened, synchronize, reopened, ready_for_review]
77
8+ permissions :
9+ contents : read
10+
811env :
912 GOPATH : /tmp/go
1013
@@ -13,33 +16,37 @@ jobs:
1316 name : Build & push operator bundles for e2e tests
1417
1518 runs-on : ubuntu-24.04
16- if : ${{ github.event.comment == '' || contains(github.event.comment.body, '/retest') || contains(github.event.comment.body, '/test all') || contains(github.event.comment.body, '/test e2e') }}
19+ if : >-
20+ ${{ github.event_name == 'pull_request_target' ||
21+ (github.event_name == 'issue_comment' &&
22+ (contains(github.event.comment.body, '/retest') ||
23+ contains(github.event.comment.body, '/test all') ||
24+ contains(github.event.comment.body, '/test e2e'))) }}
1725 steps :
18- # Checkout from PR event - in that case the comment field is empty
26+ # Checkout from PR event
1927 - name : Checkout code from PR event
2028 uses : actions/checkout@v5
21- if : ${{ github.event.comment == '' }}
29+ if : ${{ github.event_name == 'pull_request_target ' }}
2230 with :
2331 ref : ${{github.event.pull_request.head.ref}}
2432 repository : ${{github.event.pull_request.head.repo.full_name}}
2533 fetch-depth : 0
2634
2735 # If the workflow was triggered based on comment, then we need to get the information about the PR
28- # Is executed only for comment events - in that case the pull_request field is empty
2936 - name : Send Github API Request to get PR data
3037 id : request
3138 uses : octokit/request-action@v2.4.0
32- if : ${{ github.event.pull_request == '' }}
39+ if : ${{ github.event_name == 'issue_comment ' }}
3340 with :
3441 route : ${{ github.event.issue.pull_request.url }}
3542 env :
3643 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3744
3845 # Checkout the code based on the data retrieved from the previous step
39- # Is executed only for comment events - in that case the pull_request field is empty
46+ # Is executed only for comment events
4047 - name : Checkout code from PR
4148 uses : actions/checkout@v5
42- if : ${{ github.event.pull_request == '' }}
49+ if : ${{ github.event_name == 'issue_comment ' }}
4350 with :
4451 repository : ${{ fromJson(steps.request.outputs.data).head.repo.full_name }}
4552 ref : ${{ fromJson(steps.request.outputs.data).head.ref }}
5461 uses : actions/cache@v4
5562 with :
5663 path : ~/go/pkg/mod
57- key : ${{ runner.os }}-go-${{ hashFiles ('**/go.sum') }}
64+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
5865 restore-keys : |
5966 ${{ runner.os }}-go-
6067
6673 uses : codeready-toolchain/toolchain-cicd/prepare-tools-action@master
6774
6875 # Execute composite action using values from PR event
69- # Is executed only for PR events - in that case the comment field is empty
7076 - name : Publish current operator bundles for host & member based on PR event
7177 uses : codeready-toolchain/toolchain-cicd/publish-operators-for-e2e-tests@master
72- if : ${{ github.event.comment == '' }}
78+ if : ${{ github.event_name == 'pull_request_target ' }}
7379 with :
7480 quay-token : ${{ secrets.TEST_QUAY_TOKEN }}
7581 quay-namespace : codeready-toolchain-test
7985 gh-head-ref : ${{ github.event.pull_request.head.ref }}
8086
8187 # Execute composite action using values from PR event
82- # Is executed only for comment events - in that case the pull_request field is empty
8388 - name : Publish current operator bundles for host & member based on comment event
8489 uses : codeready-toolchain/toolchain-cicd/publish-operators-for-e2e-tests@master
85- if : ${{ github.event.pull_request == '' }}
90+ if : ${{ github.event_name == 'issue_comment ' }}
8691 with :
8792 quay-token : ${{ secrets.TEST_QUAY_TOKEN }}
8893 quay-namespace : codeready-toolchain-test
0 commit comments