【发布时间】:2021-05-26 09:58:57
【问题描述】:
我有一个 CI,它会在创建提交时向 Teams 发送提交消息。
Notification:
before_script:
- git show $CI_COMMIT_SHA > /tmp/changes
- export changelog=$(cat /tmp/changes)
script:
- >
curl --silent --show-error
--request POST
--header 'Content-Type: application/json'
--url "https://webhook"
--data '{"@type": "MessageCard","@context": "http://schema.org/extensions","themeColor": "0076D7","summary": "New commit","sections": [{"activityTitle": "New commit","activitySubtitle": "json","activityImage": "https:images","facts": [{"name": "Assigned to","value": "'"$GITLAB_USER_LOGIN"'"},{"name": "Message","value": "'"$CI_COMMIT_MESSAGE"'"},{"name": "Status","value": "'"$CI_JOB_STATUS"'"}]}],"potentialAction": [ {"@type": "OpenUri","name": "Link to the page with changes","targets": [{"os": "default","uri": "'"https://git/-/commit/$CI_COMMIT_SHA"'"}]}]}'
only:
- master
tags:
- VM_Mobi_Neo
我想将更改 ($changelog) 自己发送给 Teams,有人知道我该怎么做吗?
【问题讨论】:
-
请您检查一下documentation。它可能会帮助你。
标签: curl gitlab-ci microsoft-teams