forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct commit title in Slack msg (digital-asset#5471)
Currently, on a release commit on master, if the commit fails, we get the message from the target PR, which is confusing. This should (hopefully; it's a bit hard to test as it would require setting up a release PR that succeeds but fails on master) get us the title of the release commit, which hopefully will be less confusing. CHANGELOG_BEGIN CHANGELOG_END
- Loading branch information
1 parent
a96e742
commit 8261af8
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
parameters: | ||
trigger_sha: '' | ||
|
||
steps: | ||
- bash: | | ||
set -euo pipefail | ||
MESSAGE=$(git log --pretty=format:%s -n1) | ||
COMMIT_TITLE=$(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }}) | ||
COMMI_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|$COMMIT_TITLE>" | ||
if [ -z "${{ parameters.trigger_sha }}" ]; then | ||
WARNING="<!here> *FAILED* $(Agent.JobName): $COMMIT_LINK" | ||
else | ||
WARNING=":fire: :fire: :fire: :fire: :fire:\n<!here> *RELEASE FAILED* $(Agent.JobName): $COMMIT_LINK\n:fire: :fire: :fire: :fire: :fire:" | ||
fi | ||
curl -XPOST \ | ||
-i \ | ||
-H 'Content-type: application/json' \ | ||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \ | ||
--data "{\"text\":\"$WARNING\n\"}" \ | ||
$(Slack.team-daml) | ||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master')) | ||