Skip to content

Commit 81fd993

Browse files
committed
feat: add vendor id
1 parent 2a6f8e6 commit 81fd993

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

create-typings.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ export const isPR: boolean | null;
3131
* to use \`ci.TRAVIS\` instead.
3232
*/
3333
export const name: string | null;
34+
/**
35+
* Returns a string containing the identifier of the CI server the code is running on. If
36+
* CI server is not detected, it returns \`null\`.
37+
*/
38+
export const id: string | null;
3439
40+
/* Vendor constants */
3541
`
3642

3743
for (const { constant } of vendors) {

index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export const isPR: boolean | null;
2525
* to use `ci.TRAVIS` instead.
2626
*/
2727
export const name: string | null;
28+
/**
29+
* Returns a string containing the identifier of the CI server the code is running on. If
30+
* CI server is not detected, it returns `null`.
31+
*/
32+
export const id: string | null;
2833

34+
/* Vendor constants */
2935
export const AGOLA: boolean;
3036
export const APPCIRCLE: boolean;
3137
export const APPVEYOR: boolean;

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Object.defineProperty(exports, '_vendors', {
1313

1414
exports.name = null
1515
exports.isPR = null
16+
exports.id = null
1617

1718
vendors.forEach(function (vendor) {
1819
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
@@ -28,6 +29,7 @@ vendors.forEach(function (vendor) {
2829

2930
exports.name = vendor.name
3031
exports.isPR = checkPR(vendor)
32+
exports.id = vendor.constant
3133
})
3234

3335
exports.isCI = !!(

0 commit comments

Comments
 (0)