4242 - name : Obtain running job information
4343 uses : qoomon/actions--context@v4
4444
45- - name : Check for pull request
46- 47- id : pr-check
48- with :
49- # Verbose setting SHA when using Pull_Request event trigger to fix #16. (For push even trigger this is not necessary.)
50- sha : ${{ github.event.pull_request.head.sha }}
51-
5245 - name : Checkout repository
5346 uses : actions/checkout@v4
5447 with :
@@ -145,7 +138,7 @@ jobs:
145138
146139 - name : Saving vcpkg assets to cache
147140 uses : actions/cache/save@v4
148- if : ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
141+ if : ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.pull_request }}
149142 with :
150143 path : |
151144 ${{ env.VCPKG_ROOT }}
@@ -206,21 +199,14 @@ jobs:
206199 runs-on : ubuntu-latest
207200 needs : [build-generic]
208201 steps :
209- - name : Check for pull request
210- 211- id : pr-check
212- with :
213- # Verbose setting SHA when using Pull_Request event trigger to fix #16. (For push even trigger this is not necessary.)
214- sha : ${{ github.event.pull_request.head.sha }}
215-
216202 - name : Fetch artifacts
217- if : ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
203+ if : ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.pull_request }}
218204 uses : actions/download-artifact@v4
219205 with :
220206 path : artifacts/
221207
222208 - name : Remove old release
223- if : ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
209+ if : ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.pull_request }}
224210 uses :
dev-drprasad/[email protected] 225211 with :
226212 delete_release : true
@@ -229,7 +215,7 @@ jobs:
229215 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
230216
231217 - name : Repackage binaries and allow GitHub to process removed release for few seconds
232- if : ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
218+ if : ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.pull_request }}
233219 continue-on-error : true
234220 run : |
235221 cd artifacts/
@@ -242,7 +228,7 @@ jobs:
242228 sleep 20s
243229
244230 - name : Upload new release
245- if : ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
231+ if : ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.pull_request }}
246232247233 with :
248234 token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments