fix: add check for missing token input

This commit is contained in:
Peter Evans 2022-11-24 13:53:58 +09:00
parent 331d02c7e2
commit 6397b31afb
2 changed files with 7 additions and 0 deletions

3
dist/index.js vendored
View file

@ -311,6 +311,9 @@ function createPullRequest(inputs) {
return __awaiter(this, void 0, void 0, function* () {
let gitAuthHelper;
try {
if (!inputs.token) {
throw new Error(`Input 'token' not supplied. Unable to continue.`);
}
// Get the repository path
const repoPath = utils.getRepoPath(inputs.path);
// Create a git command manager

View file

@ -35,6 +35,10 @@ export interface Inputs {
export async function createPullRequest(inputs: Inputs): Promise<void> {
let gitAuthHelper
try {
if (!inputs.token) {
throw new Error(`Input 'token' not supplied. Unable to continue.`)
}
// Get the repository path
const repoPath = utils.getRepoPath(inputs.path)
// Create a git command manager