Skip to content

Commit

Permalink
fix #61 by adding documentation to required scope for ADO PAT
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcorr committed Aug 23, 2023
1 parent 515c6aa commit 7827a3b
Show file tree
Hide file tree
Showing 9 changed files with 8,209 additions and 6,672 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The definition of this Github Action is in [action.yml](https://github.com/Azure
## Sample workflow

Use this action to trigger a specific pipeline (YAML or Classic Release Pipeline) in an Azure DevOps organization.
Action takes Project URL, pipeline name and a [Personal Access Token (PAT)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops) for your DevOps account.
Action takes Project URL, pipeline name and a [Personal Access Token (PAT)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops) with the `Build (Read & execute)` scope for your DevOps organization.

```yaml
- uses: Azure/pipelines@v1
Expand Down
74 changes: 37 additions & 37 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
"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}"`);
}
});
}
exports.main = main;
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}"`);
}
});
}
exports.main = main;
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

0 comments on commit 7827a3b

Please sign in to comment.