Skip to content

Commit 6d7c7df

Browse files
Merge pull request #22 from hevans-dglcom/feature/NOTASK-add-host-variable
updated pipeline tasks to support alternative hostnames
2 parents e0d6a97 + d7a7b7c commit 6d7c7df

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

src/actions/run/createAzurePipeline.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const createAzurePipelineAction = (options: {
2626
const { integrations } = options;
2727

2828
return createTemplateAction<{
29+
server: string;
2930
organization: string;
3031
project: string;
3132
folder: string;
@@ -48,6 +49,11 @@ export const createAzurePipelineAction = (options: {
4849
],
4950
type: "object",
5051
properties: {
52+
server: {
53+
type: "string",
54+
title: "Server hostname",
55+
description: "The hostname of the Azure DevOps service. Defaults to dev.azure.com",
56+
},
5157
organization: {
5258
type: "string",
5359
title: "Organization",
@@ -93,6 +99,7 @@ export const createAzurePipelineAction = (options: {
9399
},
94100
async handler(ctx) {
95101
const {
102+
server,
96103
organization,
97104
project,
98105
folder,
@@ -102,7 +109,7 @@ export const createAzurePipelineAction = (options: {
102109
repositoryName,
103110
} = ctx.input;
104111

105-
const host = "dev.azure.com";
112+
const host = server ?? "dev.azure.com";
106113
const integrationConfig = integrations.azure.byHost(host);
107114

108115
if (!integrationConfig) {

src/actions/run/permitAzurePipeline.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const permitAzurePipelineAction = (options: {
2626
const { integrations } = options;
2727

2828
return createTemplateAction<{
29+
server: string;
2930
organization: string;
3031
project: string;
3132
resourceId: string;
@@ -47,6 +48,11 @@ export const permitAzurePipelineAction = (options: {
4748
],
4849
type: "object",
4950
properties: {
51+
server: {
52+
type: "string",
53+
title: "Server hostname",
54+
description: "The hostname of the Azure DevOps service. Defaults to dev.azure.com",
55+
},
5056
organization: {
5157
type: "string",
5258
title: "Organization",
@@ -87,6 +93,7 @@ export const permitAzurePipelineAction = (options: {
8793
},
8894
async handler(ctx) {
8995
const {
96+
server,
9097
organization,
9198
project,
9299
resourceId,
@@ -95,7 +102,7 @@ export const permitAzurePipelineAction = (options: {
95102
pipelineId,
96103
} = ctx.input;
97104

98-
const host = "dev.azure.com";
105+
const host = server ?? "dev.azure.com";
99106
const integrationConfig = integrations.azure.byHost(host);
100107

101108
if (!integrationConfig) {

src/actions/run/runAzurePipeline.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const runAzurePipelineAction = (options: {
5252
}
5353

5454
return createTemplateAction<{
55+
server: string;
5556
organization: string;
5657
pipelineId: string;
5758
project: string;
@@ -62,9 +63,18 @@ export const runAzurePipelineAction = (options: {
6263
id: "azure:pipeline:run",
6364
schema: {
6465
input: {
65-
required: ["organization", "pipelineId", "project"],
66+
required: [
67+
"organization",
68+
"pipelineId",
69+
"project"
70+
],
6671
type: "object",
6772
properties: {
73+
server: {
74+
type: "string",
75+
title: "Server hostname",
76+
description: "The hostname of the Azure DevOps service. Defaults to dev.azure.com",
77+
},
6878
organization: {
6979
type: "string",
7080
title: "Organization",
@@ -99,9 +109,16 @@ export const runAzurePipelineAction = (options: {
99109
},
100110
},
101111
async handler(ctx) {
102-
const { organization, pipelineId, project, branch, values } = ctx.input;
112+
const {
113+
server,
114+
organization,
115+
pipelineId,
116+
project,
117+
branch,
118+
values
119+
} = ctx.input;
103120

104-
const host = "dev.azure.com";
121+
const host = server ?? "dev.azure.com";
105122
const integrationConfig = integrations.azure.byHost(host);
106123

107124
if (!integrationConfig) {

0 commit comments

Comments
 (0)