Skip to content

Commit 5ea8d85

Browse files
authored
feat: add better support azure pipelines (#116)
1 parent 8e2b9d2 commit 5ea8d85

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ test('AppVeyor - Not PR', function (t) {
124124
})
125125

126126
test('Azure Pipelines - PR', function (t) {
127-
process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = 'https://dev.azure.com/Contoso'
128-
process.env.SYSTEM_PULLREQUEST_PULLREQUESTID = '42'
127+
process.env.TF_BUILD = 'true'
128+
process.env.BUILD_REASON = 'PullRequest'
129129

130130
clearModule('./')
131131
const ci = require('./')
@@ -136,14 +136,14 @@ test('Azure Pipelines - PR', function (t) {
136136
t.equal(ci.AZURE_PIPELINES, true)
137137
assertVendorConstants('AZURE_PIPELINES', ci, t)
138138

139-
delete process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
140-
delete process.env.SYSTEM_PULLREQUEST_PULLREQUESTID
139+
delete process.env.TF_BUILD
140+
delete process.env.BUILD_REASON
141141

142142
t.end()
143143
})
144144

145145
test('Azure Pipelines - Not PR', function (t) {
146-
process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = 'https://dev.azure.com/Contoso'
146+
process.env.TF_BUILD = 'true'
147147

148148
clearModule('./')
149149
const ci = require('./')
@@ -154,7 +154,7 @@ test('Azure Pipelines - Not PR', function (t) {
154154
t.equal(ci.AZURE_PIPELINES, true)
155155
assertVendorConstants('AZURE_PIPELINES', ci, t)
156156

157-
delete process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
157+
delete process.env.TF_BUILD
158158

159159
t.end()
160160
})

vendors.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
{
1919
"name": "Azure Pipelines",
2020
"constant": "AZURE_PIPELINES",
21-
"env": "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",
22-
"pr": "SYSTEM_PULLREQUEST_PULLREQUESTID"
21+
"env": "TF_BUILD",
22+
"pr": {
23+
"BUILD_REASON": "PullRequest"
24+
}
2325
},
2426
{
2527
"name": "Bamboo",

0 commit comments

Comments
 (0)