OndraM / ci-detector

Detect continuous integration environment and get information of current build
MIT License
212 stars 12 forks source link

Head branch retrieval support #93

Closed sanmai closed 3 years ago

sanmai commented 3 years ago

Fixes #82

This is a BC break, hence it is time for a next major version.

Implementation status:

sanmai commented 3 years ago

Also, I'm not entirely sure what do you meant in the issue:

It does not check for PR branch because it is not our call make this check. A CI might have this variable even if we don't know for certain if a build is a PR build. And it is a lot simpler this way.

I meant that we don't do checks for a PR build, assuming that if it is then we'll have an expected variable for a branch. In other words, we check if there's an expected variable, and return it.

sanmai commented 3 years ago

and you can also sqash all together in one commit

It'll be far simpler for you to just squash-merge. WDYT?

OndraM commented 3 years ago

I meant that we don't do checks for a PR build, assuming that if it is then we'll have an expected variable for a branch. In other words, we check if there's an expected variable, and return it.

This basically means target branch detection is intentionally independent on pull request detection, right? I'm not saying it should be, but generally speaking - if we can detect target branch, it means we should be able to tell this is PR build (but obviously not vice-versa). And from what I can see this is true in all cases in this PR - only Jenkins, TeamCity and Wercker does not support PR detection, and they does not support target branch detection as well. So yeah, that makes sense :)