ondram/ci-detector
Detect continuous integration environment and provide unified access to properties of current build
4.2.0
59M downloads/mo
#444 most downloaded on Packagist
OndraM/ci-detector
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 2.9 years
Most releases are documented
notes for 15 of 19 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
19 releases · first in 2016
0 releases in the last 12 months
see the full history below
Release timeline
18 releases · Jul 2016 to Mar 2024Releases
latest 19-
4.2.012 Mar 2024 -
4.1.014 Apr 2021 -
4.0.002 Feb 2021Release notes
Open source →Added
getTargetBranch()method to return the name of the branch where current branch is targeted (aka "base branch").- Azure DevOps Pipelines detection support.
CiDetectorInterface(extended byCiDetector) to allow simpler extension.
Fixed
- Fix build URL detection on Travis (it always reported travis-ci.org URL, even if the build was on travis-ci.com).
Changed
- [BC break] Rename methods to make them VCS-agnostic. Use
getCommit()instead ofgetGitCommit()andgetBranch()instead ofgetGitBranch(). - [BC break] Declare
CiDetectorconstructor final.
Removed
- [BC break] Remove
Travis::TRAVIS_BASE_URLconstant.
-
3.5.104 Sep 2020 -
3.5.025 Aug 2020Release notes
Open source →- Use more suitable value for "build number" on GitHub Actions.
- Add Wercker detection support.
-
3.4.011 May 2020Release notes
Open source →- Add AWS CodeBuild detection support.
- Add Bitbucket Pipelines support.
- Allow late static binding in
CiDetector::fromEnvironment()when inheriting the class. - Fix branch detection in PR builds on AppVeyor, Buddy and GitHub Actions (target branch of the PR was returned instead).
-
3.3.006 Mar 2020Release notes
Open source →- Allow injecting instance of
EnvusingCiDetector::fromEnvironment()(useful for environment mocking in unit tests).
- Allow injecting instance of
-
3.2.018 Feb 2020Release notes
Open source →- Add GitHub Actions detection support.
- Add Buddy detection support.
- Add
getRepositoryName()method to detect repository name (slug) likeOndraM/ci-detector(not supported on TeamCity, Jenkins and continuousphp). - Add
isPullRequest()to detect if current build has been triggered by a pull request (merge request). Be aware that this method returns aTrinaryLogicobject to handle cases when it cannot be detected whether build was triggered by a pull request (like on TeamCity and Jenkins CI). - Change build URL on AppVeyor to use new permalink URL.
-
3.1.110 Nov 2019Release notes
Open source →- Fix Gitlab 9.0+ support (environment variables were renamed in GitLab 9.0+).
-
3.1.019 Feb 2018 -
3.0.027 Oct 2017 -
2.1.026 May 2017 -
2.0.007 Jan 2017Release notes
Open source →- [BC break] The
detect()method ofCiDetectorclass is no longer static. - [BC break] Rearrange namespaces, all classes are now in
CiDetectorsub-namespace. - Added
isCiDetected()method to detect if current environment is CI. - [BC break]
detect()method always returns instance ofCiInterfaceand throwsCiNotDetectedExceptionif CI environment is not detected.
- [BC break] The
-
1.1.006 Jan 2017Release notes
Open source →- Add
getGitBranch()method to detect Git branch of the build (supported by all CIs except TeamCity). - Add
getRepositoryUrl()method to detect repository source URL (not supported Codeship, TeamCity, Travis).
- Add
-
1.0.019 Aug 2016Release notes
Open source →- Initial release supporting Jenkins, Travis CI, Bamboo, CircleCI, Codeship, GitLab and TeamCity services.
-
0.4.004 Aug 2016Nothing published for this version
-
0.3.0no dateNothing published for this version
-
0.2.029 Jul 2016Nothing published for this version
-
0.1.029 Jul 2016Nothing published for this version