Skip to content

Commit 5868462

Browse files
Merge pull request #11 from Parfuemerie-Douglas/variable-branch-v1.6.0
Variablize the pipeline's repository branch for Backstage release v1.6.0
2 parents 94b995f + 1f76efd commit 5868462

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@parfuemerie-douglas/scaffolder-backend-module-azure-pipelines",
3-
"version": "0.4.2-next.0",
3+
"version": "0.4.2",
44
"description": "A collection of Backstage scaffolder backend modules for Azure pipelines.",
55
"main": "dist/index.cjs.js",
66
"types": "dist/index.d.ts",
@@ -39,16 +39,16 @@
3939
},
4040
"homepage": "https://github.com/Parfuemerie-Douglas/scaffolder-backend-module-azure-pipelines#readme",
4141
"dependencies": {
42-
"@backstage/backend-common": "^0.15.2-next.0",
43-
"@backstage/errors": "^1.1.2-next.0",
44-
"@backstage/integration": "^1.3.2-next.0",
45-
"@backstage/plugin-scaffolder-backend": "^1.7.0-next.0",
42+
"@backstage/backend-common": "^0.15.1",
43+
"@backstage/errors": "^1.1.1",
44+
"@backstage/integration": "^1.3.1",
45+
"@backstage/plugin-scaffolder-backend": "^1.6.0",
4646
"@backstage/types": "^1.0.0",
4747
"@types/node-fetch": "^2.6.2",
4848
"node-fetch": "2"
4949
},
5050
"devDependencies": {
51-
"@backstage/cli": "^0.20.0-next.0"
51+
"@backstage/cli": "^0.19.0"
5252
},
5353
"files": [
5454
"dist"

src/actions/run/runAzurePipeline.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const runAzurePipelineAction = (options: {
2929
organization: string;
3030
pipelineId: string;
3131
project: string;
32+
branch?: string;
3233
token?: string;
3334
}>({
3435
id: "azure:pipeline:run",
@@ -52,16 +53,21 @@ export const runAzurePipelineAction = (options: {
5253
title: "Project",
5354
description: "The name of the Azure project.",
5455
},
56+
branch: {
57+
title: "Repository Branch",
58+
type: "string",
59+
description: "The branch of the pipeline's repository.",
60+
},
5561
token: {
56-
title: "Authenticatino Token",
62+
title: "Authentication Token",
5763
type: "string",
5864
description: "The token to use for authorization.",
5965
},
6066
},
6167
},
6268
},
6369
async handler(ctx) {
64-
const { organization, pipelineId, project } = ctx.input;
70+
const { organization, pipelineId, project, branch } = ctx.input;
6571

6672
const host = "dev.azure.com";
6773
const integrationConfig = integrations.azure.byHost(host);
@@ -98,7 +104,7 @@ export const runAzurePipelineAction = (options: {
98104
resources: {
99105
repositories: {
100106
self: {
101-
refName: "refs/heads/master",
107+
refName: `refs/heads/${branch ?? "main"}`,
102108
},
103109
},
104110
},

0 commit comments

Comments
 (0)