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

Add optional parameters ref and sha #23

Open
wants to merge 2 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
34 changes: 22 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
name: 'Azure Pipelines Action'
description: 'Trigger a run in Azure pipelines'
name: 'Azure Pipelines Action'
description: 'Trigger a run in Azure pipelines'
inputs:
azure-devops-project-url:
description: 'Fullyqualified URL to the Azure DevOps organization along with project name(eg, https://dev.azure.com/organization/project-name or https://server.example.com:8080/tfs/DefaultCollection/project-name)'
required: true
description: 'Fullyqualified URL to the Azure DevOps organization along with project name(eg, https://dev.azure.com/organization/project-name or https://server.example.com:8080/tfs/DefaultCollection/project-name)'
required: true
azure-pipeline-name:
description: 'Name of the Azure Pipline to be triggered'
required: true
azure-devops-token:
description: 'Paste personal access token of the user as value of secret variable:AZURE_DEVOPS_TOKEN'
required: true
runs:
using: 'node12'
main: 'lib/main.js'
description: 'Name of the Azure Pipeline to be triggered'
required: false
azure-pipeline-id:
description: 'The build definition ID of the Azure Pipeline to be triggered'
required: false
azure-devops-token:
description: 'Paste personal access token of the user as value of secret variable:AZURE_DEVOPS_TOKEN'
required: true
ref:
description: 'Specify to override the default ref ($GITHUB_REF)'
required: false
sha:
description: 'Specify to override the default sha ($GITHUB_SHA)'
required: false

runs:
using: 'node12'
main: 'lib/main.js'
72 changes: 36 additions & 36 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
"use strict";
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());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
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}"`);
}
});
}
main();
"use strict";
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());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
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}"`);
}
});
}
main();
20 changes: 10 additions & 10 deletions lib/pipeline.error.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
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 });
class PipelineNotFoundError extends Error {
constructor(m) {
super(m);
// Required to allow use of "instanceof"
Object.setPrototypeOf(this, PipelineNotFoundError.prototype);
}
}
exports.PipelineNotFoundError = PipelineNotFoundError;
Loading