Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added template parameters #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Action takes Project URL, pipeline name and a [Personal Access Token (PAT)](http
azure-pipeline-name: 'pipeline-name' # name of the Azure pipeline to be triggered
azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'
azure-pipeline-variables: '{"variable1": "value1", "variable2": "value2"}' # optional stringified json
azure-template-parameters: '{"variable1": "value1", "variable2": "value2"}' # optional stringified json
```

# Contributing
Expand Down
15 changes: 9 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Azure Pipelines Action'
name: 'Azure Pipelines Action'
description: 'Trigger a run in Azure pipelines'
inputs:
azure-devops-project-url:
Expand All @@ -10,9 +10,12 @@ inputs:
azure-pipeline-variables:
description: 'Set/Overwrite pipeline variables'
required: false
azure-devops-token:
description: 'Paste personal access token of the user as value of secret variable:AZURE_DEVOPS_TOKEN'
required: true
azure-template-parameters:
description: 'Set pipeline template parameters'
required: false
azure-devops-token:
description: 'Paste personal access token of the user as value of secret variable:AZURE_DEVOPS_TOKEN'
required: true
runs:
using: 'node16'
main: 'dist/index.js'
using: 'node16'
main: 'dist/index.js'
100 changes: 50 additions & 50 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.main = void 0;
const core = __importStar(require("@actions/core"));
const task_parameters_1 = require("./task.parameters");
const pipeline_runner_1 = require("./pipeline.runner");
function main() {
return __awaiter(this, void 0, void 0, function* () {
try {
const pipelineRunner = new pipeline_runner_1.PipelineRunner(task_parameters_1.TaskParameters.getTaskParams());
core.debug("Starting pipeline runner");
yield pipelineRunner.start();
core.debug("pipeline runner completed");
}
catch (error) {
const errorMessage = JSON.stringify(error);
core.setFailed(`Error: "${error.message}" Details: "${errorMessage}"`);
}
});
}
exports.main = main;
main();
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.main = void 0;
const core = __importStar(require("@actions/core"));
const task_parameters_1 = require("./task.parameters");
const pipeline_runner_1 = require("./pipeline.runner");
function main() {
return __awaiter(this, void 0, void 0, function* () {
try {
const pipelineRunner = new pipeline_runner_1.PipelineRunner(task_parameters_1.TaskParameters.getTaskParams());
core.debug("Starting pipeline runner");
yield pipelineRunner.start();
core.debug("pipeline runner completed");
}
catch (error) {
const errorMessage = JSON.stringify(error);
core.setFailed(`Error: "${error.message}" Details: "${errorMessage}"`);
}
});
}
exports.main = main;
main();
22 changes: 11 additions & 11 deletions lib/pipeline.error.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PipelineNotFoundError = void 0;
class PipelineNotFoundError extends Error {
constructor(m) {
super(m);
// Required to allow use of "instanceof"
Object.setPrototypeOf(this, PipelineNotFoundError.prototype);
}
}
exports.PipelineNotFoundError = PipelineNotFoundError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PipelineNotFoundError = void 0;
class PipelineNotFoundError extends Error {
constructor(m) {
super(m);
// Required to allow use of "instanceof"
Object.setPrototypeOf(this, PipelineNotFoundError.prototype);
}
}
exports.PipelineNotFoundError = PipelineNotFoundError;
Loading