Commit 7eb4495 1 parent a242bca commit 7eb4495 Copy full SHA for 7eb4495
File tree 1 file changed +39
-0
lines changed
1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 88
88
piper-version : master
89
89
command : githubPublishRelease
90
90
flags : --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./target/jenkins-library.jar
91
+
92
+ post :
93
+ name : Post Action
94
+ runs-on : ubuntu-latest
95
+ needs : [build]
96
+ if : always()
97
+ steps :
98
+ # Check status of the worklfow
99
+ - uses : martialonline/workflow-status@v4
100
+ id : check
101
+
102
+ # This step expects base64 encoded JSON object as below:
103
+ # {
104
+ # "smtp_url": "smtp+starttls://user:password@server:port",
105
+ # "smtp_mail_from": "[email protected] ",
106
+ # "smtp_mail_rcpt": "[email protected] ",
107
+ # }
108
+ - name : Decode SMTP secrets and set them in GITHUB_ENV
109
+ id : smtp_secrets
110
+ if : steps.check.outputs.status == 'failure' || steps.check.outputs.status == 'cancelled'
111
+ run : >
112
+ echo "${{ secrets.SMTP_CONFIG }}" |
113
+ base64 --decode |
114
+ jq -r 'to_entries[] | "\(.key)=\(.value)"' |
115
+ while read line; do
116
+ echo "$line" >> $GITHUB_ENV; echo "::add-mask::${line#*=}";
117
+ done
118
+ - name : Notify Piper team on failure or cancelled
119
+ if : steps.smtp_secrets.conclusion == 'success'
120
+ uses : dawidd6/action-send-mail@v3
121
+ with :
122
+ connection_url : ${{ env.smtp_url }}
123
+ subject : Workflow failure in ${{ github.repository }}
124
+ priority : high
125
+ to : ${{ env.smtp_mail_rcpt }}
126
+ from : Piper on GitHub <${{ env.smtp_mail_from }}>
127
+ body : |
128
+ Workflow '${{ github.workflow }}' has a job with status '${{ steps.check.outputs.status }}'.
129
+ Workflow link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
You can’t perform that action at this time.
0 commit comments