File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 8181 major_version="${major_version%%.*}"
8282 echo "MAJOR_VERSION=$major_version" >> $GITHUB_ENV
8383
84+ - name : Force failure for testing
85+ run : exit 1
86+
8487 - name : Store the GCP key in a file
8588 if : env.MAJOR_VERSION == '2'
8689 env :
@@ -138,3 +141,21 @@ jobs:
138141 run : |
139142 echo "Updating monitoring app for testnet deployment..."
140143 ./spartan/metrics/testnet-monitor/scripts/update-monitoring.sh testnet ${{ env.MONITORING_NAMESPACE }}
144+
145+ - name : Notify Slack on failure
146+ if : failure() && env.MAJOR_VERSION == '2'
147+ env :
148+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
149+ run : |
150+ if [ -n "${SLACK_BOT_TOKEN}" ]; then
151+ read -r -d '' data <<EOF
152+ {
153+ "channel": "#alerts-next-${{ inputs.network }}",
154+ "text": "Deploy Staging Network workflow FAILED for *${{ inputs.network }}* (version ${{ inputs.semver }}): <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
155+ }
156+ EOF
157+ curl -X POST https://slack.com/api/chat.postMessage \
158+ -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
159+ -H "Content-type: application/json" \
160+ --data "$data"
161+ fi
You can’t perform that action at this time.
0 commit comments