daml/ci/daily_tell_slack.yml
Gary Verhaegen 93f449d245
rename master to main (#8245)
As we strive for more inclusiveness, we are becoming less comfortable
with historically-charged terms being used in our everyday work.

This is targeted for merge on Dec 26, _after_ the necessary
corresponding changes at both the GitHub and Azure Pipelines levels.

CHANGELOG_BEGIN

- DAML Connect development is now conducted from the `main` branch,
  rather than the `master` one. If you had any dependency on the
  digital-asset/daml repository, you will need to update this parameter.

CHANGELOG_END
2020-12-27 14:19:07 +01:00

32 lines
1.1 KiB
YAML

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
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)"
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
MESSAGE="${{ parameters['success-message'] }}"
fi
PAYLOAD="{\"text\":$MESSAGE}"
if [ "$(Build.SourceBranchName)" = "main" ]; then
curl -XPOST \
-i \
-H 'Content-type: application/json' \
--data "$PAYLOAD" \
$(Slack.team-daml)
fi
displayName: report
condition: always()