File tree 1 file changed +36
-11
lines changed
1 file changed +36
-11
lines changed Original file line number Diff line number Diff line change @@ -203,15 +203,31 @@ jobs:
203
203
formatted="${formatted%\\n}" # Remove the last newline
204
204
echo "formatted_results=${formatted}" >> $GITHUB_OUTPUT
205
205
206
- - name : Send Slack Notification
207
- uses : 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
208
- with :
209
- author_name : ' powsybl-metrix on GitHub'
210
- status : custom
211
- custom_payload : |
212
- {
213
- attachments: [{
214
- color: '${{ job.status }}' === 'success' ? "#319f4b" : '${{ job.status }}' === 'failure' ? "#f64538" : "#ffc965",
206
+ - name : Prepare Slack payload
207
+ id : prepare_payload
208
+ run : |
209
+ if [ "${{ steps.workflow_status.outputs.status }}" == "Successful" ]; then
210
+ echo 'payload<<EOF' >> $GITHUB_OUTPUT
211
+ echo '{
212
+ "attachments": [{
213
+ "color": "#319f4b",
214
+ "blocks": [
215
+ {
216
+ "type": "section",
217
+ "text": {
218
+ "type": "mrkdwn",
219
+ "text": "${{ steps.workflow_status.outputs.icon }} *${{ steps.workflow_status.outputs.status }} workflow: Snapshot-CI on <https://github.com/powsybl/powsybl-metrix|powsybl-metrix>*\n\nBranch built: ${{ needs.build_powsybl_metrix.outputs.metrix-branch }}\nPowSyBl-Core version used: ${{ needs.build_powsybl_metrix.outputs.core-version }}\n\nSee logs on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub>"
220
+ }
221
+ }
222
+ ]
223
+ }]
224
+ }' >> $GITHUB_OUTPUT
225
+ echo 'EOF' >> $GITHUB_OUTPUT
226
+ else
227
+ echo 'payload<<EOF' >> $GITHUB_OUTPUT
228
+ echo '{
229
+ "attachments": [{
230
+ "color": "#f64538",
215
231
"blocks": [
216
232
{
217
233
"type": "section",
@@ -232,6 +248,15 @@ jobs:
232
248
}
233
249
]
234
250
}]
235
- }
251
+ }' >> $GITHUB_OUTPUT
252
+ echo 'EOF' >> $GITHUB_OUTPUT
253
+ fi
254
+
255
+ - name : Send Slack Notification
256
+ uses : 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
257
+ with :
258
+ author_name : ' powsybl-metrix on GitHub'
259
+ status : custom
260
+ custom_payload : ${{ steps.prepare_payload.outputs.payload }}
236
261
env :
237
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL_METRIX }}
262
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_POWSYBL_WEBHOOK_URL }}
You can’t perform that action at this time.
0 commit comments