File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: 'GitHub: Release'
2
2
3
3
on :
4
4
workflow_call :
5
+ inputs :
6
+ deployment_status :
7
+ required : true
8
+ type : string
5
9
6
10
# Special permissions required for OIDC authentication
7
11
permissions :
13
17
gh-release-publish :
14
18
name : ' GitHub: Publish Release'
15
19
runs-on : ubuntu-latest
16
- if : github.event_name == 'release' && success()
20
+ if : inputs.deployment_status == 'success'
17
21
env :
18
22
GH_TOKEN : ${{ secrets.GH_TOKEN }}
19
23
steps :
30
34
gh-release-delete :
31
35
name : ' GitHub: Delete Prerelease'
32
36
runs-on : ubuntu-latest
33
- if : github.event_name == 'release' && failure() || cancelled()
37
+ if : inputs.deployment_status != 'success'
34
38
env :
35
39
GH_TOKEN : ${{ secrets.GH_TOKEN }}
36
40
steps :
Original file line number Diff line number Diff line change 6
6
environment :
7
7
required : true
8
8
type : string
9
+ outputs :
10
+ deployment_status :
11
+ description : " The status of the deployment"
12
+ value : ${{ jobs.k8-deploy.outputs.deployment_status }}
9
13
10
14
11
15
# Special permissions required for OIDC authentication
30
34
AZURE_RESOURCE_GROUP : " ${{ vars.AZURE_RESOURCE_GROUP }}"
31
35
AZURE_CONTAINER_REGISTRY : " ${{ vars.AZURE_CONTAINER_REGISTRY }}"
32
36
IMAGE_TAG : ${{ github.event_name == 'release' && github.event.release.tag_name || 'latest' }}
37
+ outputs :
38
+ deployment_status : ${{ steps.assert_deployment_success.outcome }}
33
39
steps :
34
40
# Checkout the repository to the GitHub Actions runner
35
41
- name : Checkout
89
95
percentage : 20
90
96
91
97
- name : Assert Deployment Success
98
+ id : assert_deployment_success
92
99
timeout-minutes : 5
93
100
shell : bash
94
101
run : |
Original file line number Diff line number Diff line change 34
34
needs : [call-k8-deploy]
35
35
if : always() && github.event_name == 'release'
36
36
secrets : inherit
37
+ with :
38
+ deployment_status : ${{ needs.call-k8-deploy.outputs.deployment_status }}
37
39
38
40
call-gh-delete-branch :
39
41
needs : [call-k8-deploy]
You can’t perform that action at this time.
0 commit comments