Skip to content

Commit

Permalink
Send MM message in case of App Store Release failure (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 authored Feb 19, 2024
1 parent f9e53db commit 578352d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ jobs:
--form "file=@${asana_dsyms_path};type=application/zip"
fi
- name: Send Mattermost message
- name: Send Mattermost message
if: ${{ success() || failure() }} # Don't execute when cancelled
env:
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
DESTINATION: ${{ steps.destination.outputs.destination }}
Expand All @@ -117,9 +118,8 @@ jobs:
if [[ -z "${MM_USER_HANDLE}" ]]; then
echo "Mattermost user handle not known for ${{ github.actor }}, skipping sending message"
else
else
curl -s -H 'Content-type: application/json' \
-d "$(envsubst < ./scripts/assets/appstore-release-mm-template.json)" \
-d "$(envsubst < ./scripts/assets/appstore-release-mm-template.json | jq ".${{ job.status }}")" \
${{ secrets.MM_WEBHOOK_URL }}
fi
15 changes: 14 additions & 1 deletion scripts/assets/appstore-release-mm-template.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"channel":"${MM_USER_HANDLE}","username":"GitHub Actions","text":"**iOS app has been successfully uploaded to ${DESTINATION}** :goose_honk_tada: | [:github: Workflow run summary](${WORKFLOW_URL})","icon_url":"https://duckduckgo.com/assets/logo_header.v108.svg"}
{
"failure": {
"channel": "${MM_USER_HANDLE}",
"username": "GitHub Actions",
"text": ":warning: **iOS release job failed** :thisisfine: | [:github: Workflow run summary](${WORKFLOW_URL})",
"icon_url": "https://duckduckgo.com/assets/logo_header.v108.svg"
},
"success": {
"channel": "${MM_USER_HANDLE}",
"username": "GitHub Actions",
"text": "**iOS app has been successfully uploaded to ${DESTINATION}** :goose_honk_tada: | [:github: Workflow run summary](${WORKFLOW_URL})",
"icon_url": "https://duckduckgo.com/assets/logo_header.v108.svg"
}
}

0 comments on commit 578352d

Please sign in to comment.