dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 439 forks source link

Build a Tag from Github Webhook fails #1296

Closed ktomk closed 2 years ago

ktomk commented 7 years ago

Expected behaviour

Git clone operation works

Actual behaviour

Git clone operation fails.

Steps to reproduce

Logs or other output that would be helpful

Cloning into '/srv/wwwroot/example.com/phpci/PHPCI/build/39_1c712'...
fatal: Remote branch refs/tags/1.97.28 not found in upstream origin

Failed to clone remote git repository.
Exception: Konnte keine Arbeitskopie erstellen.
E_WARNING: array_key_exists() expects parameter 2 to be array, null given
Bearbeiten der Builds abgeschlossen.

In this line: https://github.com/Block8/PHPCI/blob/64b0f60368c6cc6a6373dc316510c276c2f508d4/PHPCI/Model/Build/RemoteGitBuild.php#L101

Git is commanded to clone refs/tags/<tag-name> as a branch which git refuses with the logged error.

Cloning a tag works for me in git by using the tag-name directly.

(I could not find a location where the payload of the webhook was available for review that has triggered the build.)

Building a tag is only possible for me when I enter the URL manually with the fixed name of the "branch" that is the tag-name only (.e.g 1.97.28):

http://example.com/project/build/1/1.97.28