Comments (8)
@sibiraj-s Oh yes, I was actually thinking to put this into ci-info. I forgot this issue was opened on the is-ci module. Then an is-pr module can depend on it just like is-ci currently does.
from is-ci.
@zixia The module is-pr have now been released to npm - please take it for a spin and let me know what you think 😃
It has support for the CI servers @sibiraj-s listed above, except Codeship.
The reason why Codeship isn't supported is because of this note I found when reading about its CI_PULL_REQUEST
environment variable:
Note: The value of
CI_PULL_REQUEST
isfalse
, and doesn’t indicate if a commit has a corresponding pull request, or if the build was triggered by a pull request. The variable exists because some third-party integrations require its existence.
from is-ci.
I think this is going to be tough to normalize across CI systems. Travis is easy because it's so tightly integrated with the GitHub workflow, but a lot of other CI systems approach this in a more generic way AFAIK. So I'm not really sure if this is feasible?
from is-ci.
Yes, also only few exposes the constants in the build Environment too.
@watson If this feature is going to be accepted. checkout the following env constants
- TRAVIS_PULL_REQUEST (boolean)
- CIRCLE_PULL_REQUEST
- APPVEYOR_PULL_REQUEST_NUMBER
- BUILDKITE_PULL_REQUEST
- CIRRUS_PR
- CI_PULL_REQUEST (codeship - boolean)
- PULL_REQUEST_NUMBER (semaphore)
- IS_PULL_REQUEST (shippable - boolean)
- TDDIUM_PR_ID (solano)
from is-ci.
Thank @watson for your reply, and thank @sibiraj-s very much for your supported CI and environment variables list!
I think this feature will be very useful for us when we are using a CI that integrated with GitHub PR workflow.
As we had already listed the supported CI and environment variables, how about let's implement an isPullRequest()
method, which can return true
/false
if we are sure this is(or not) a PR under CI, or throw an Exception if there's a CI that does not support to identify the PR, so that the user will know he can not use isPullRequest
in their CI?
from is-ci.
Yes, thank you @sibiraj-s for the great research. It's more commonly exposed than I feared.
I guess it doesn't hurt to expose this in some way with proper documentation about that it's not always supported.
I'm hesitant to throw an exception though 🤔 I'm thinking we instead could return null
in the cases where it's not supported?
from is-ci.
Instead of having it here, Just a thought. why not a separate is-pr
lib instead.
is-pr
can have its own documentation for supported CI's.
from is-ci.
Awesome,I'll try it out later.
Thank you very much for creating those great modules!
from is-ci.
Related Issues (9)
- add information on what CI is running HOT 6
- Add CLI HOT 1
- add support for netlify HOT 1
- Support Travis CI Windows env HOT 1
- Support TFS Build
- Negative check is-not-ci? HOT 3
- Add support for Ionic AppFlow HOT 1
- Error deploying Express app with 'fast-two-sms' package on Vercel due to 'is-ci' module not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from is-ci.