deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.41k stars 1.47k forks source link

Ms-teams always reports branch as defined in server config, not actually used branch #3778

Open lxlang opened 4 months ago

lxlang commented 4 months ago

Example Config:

import:
  - recipe/laravel.php
  - contrib/ms-teams.php

config:
  application: 'my-app'

  teams_webhook: https://deploy.requestcatcher.com
  teams_text: "_{{user}}_ deploying `{{branch}}` to *{{name}}*"

hosts:
  server:
    name: my-server
    branch: master

after:
  deploy:info:
    - teams:notify

When deploying any other branch then the one defined in server-config, the wrong branch is reported to teams.

$> dep deploy:info --branch test -vv
task deploy:info
[server] info deploying test
done on server
done deploy:info 92ms
task teams:notify
[localhost] run git config --get user.name
[localhost] User Name
done on server
done teams:notify 697ms

The received webhook:

POST / HTTP/1.1
Host: deploy.requestcatcher.com
Accept: */*
Content-Length: 99
Content-Type: application/json
User-Agent: Deployer 7.3.3

{
    "themeColor": "#4d91f7",
    "text": "_User Name_ deploying `master` to *my-server*"
}

Expected behavior:

The given branch name gets reported to teams.

Upvote & Fund

Fund with Polar