【问题标题】:How to send commit changes from GitLab to Teams如何将提交更改从 GitLab 发送到团队
【发布时间】: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,有人知道我该怎么做吗?

【问题讨论】:

标签: curl gitlab-ci microsoft-teams


【解决方案1】:

您可以将 Microsoft Teams 与 GitLab 集成,并在 Microsoft Teams 中显示有关 GitLab 项目的通知。

Configure Microsoft Teams 启用 webhook 以侦听更改。

Configure your GitLab project 将通知推送到 Microsoft Teams webhook

查看此docs 更多详细信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-12
    • 1970-01-01
    • 2018-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    • 2017-12-17
    相关资源
    最近更新 更多