File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -32,20 +32,11 @@ permissions:
3232jobs :
3333 metadata :
3434 runs-on : ubuntu-22.04
35+ if : github.event.pull_request.draft == false || github.event_name != 'pull_request'
3536 outputs :
3637 BUILD_DATE : ${{ steps.date.outputs.BUILD_DATE }}
3738 PUBLISH : ${{ steps.if-publish.outputs.PUBLISH }}
3839 steps :
39- - name : Cancel workflow run if the trigger is a draft PR
40- id : cancel-if-draft
41- if : github.event_name == 'pull_request' && github.event.pull_request.draft == true
42- run : |
43- echo "Cancelling workflow for draft PR"
44- curl -X POST -H "Authorization: token ${{ github.token }}" \
45- -H "Accept: application/vnd.github.v3+json" \
46- "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
47- while true; do sleep 1; done # blocks execution in case workflow cancellation takes time
48-
4940 - name : Set build date
5041 id : date
5142 shell : bash -x -e {0}
You can’t perform that action at this time.
0 commit comments