mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 04:45:57 +03:00
Fix slack escaping (#8311)
The previous escaping syntax doesn’t seem to work (after the first layer you no longer have a variable) and has broken our build reporting completely. changelog_begin changelog_end
This commit is contained in:
parent
1f048af9d8
commit
fbf1820f94
@ -9,6 +9,14 @@ steps:
|
||||
set -euo pipefail
|
||||
TMP=$(mktemp)
|
||||
cat > $TMP <<'END'
|
||||
escape_slack() {
|
||||
local r
|
||||
r="$1"
|
||||
r="${r//&/&}"
|
||||
r="${r//>/>}"
|
||||
r="${r//</<}"
|
||||
echo "$r"
|
||||
}
|
||||
get_gh_auth_header() {
|
||||
# Credentials are persisted in a different way on GCP and Azure nodes.
|
||||
if header=$(git config 'http.https://github.com/digital-asset/daml.extraheader'); then
|
||||
|
@ -5,11 +5,15 @@ parameters:
|
||||
success-message: '\"$(Agent.JobName) passed: $COMMIT_LINK\"'
|
||||
|
||||
steps:
|
||||
- template: bash-lib.yml
|
||||
parameters:
|
||||
var_name: bash_lib
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
eval "$(dev-env/bin/dade assist)"
|
||||
COMMIT_TITLE=$(git log --pretty=format:%s -n1)
|
||||
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|${${${COMMIT_TITLE//&/&}//>/>}//</<}>"
|
||||
source $(bash_lib)
|
||||
COMMIT_TITLE="$(escape_slack $(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }}))"
|
||||
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|${COMMIT_TITLE}>"
|
||||
if [ "$(Agent.JobStatus)" != "Succeeded" ]; then
|
||||
MESSAGE="\":fire: :fire: <!here> :fire: :fire:\n$(Agent.JobName) *FAILED*: $COMMIT_LINK\n:fire: :fire:\""
|
||||
else
|
||||
|
@ -5,10 +5,14 @@ parameters:
|
||||
trigger_sha: ''
|
||||
|
||||
steps:
|
||||
- template: bash-lib.yml
|
||||
parameters:
|
||||
var_name: bash_lib
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
COMMIT_TITLE=$(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }})
|
||||
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|${${${COMMIT_TITLE//&/&}//>/>}//</<}>"
|
||||
source $(bash_lib)
|
||||
COMMIT_TITLE="$(escape_slack $(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }}))"
|
||||
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|${COMMIT_TITLE}>"
|
||||
if [ -z "${{ parameters.trigger_sha }}" ]; then
|
||||
WARNING="<!here> *FAILED* $(Build.SourceBranchName)/$(Agent.JobName): $COMMIT_LINK"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user