Skip to content

Commit

Permalink
fix: add check for missing token input (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Nov 28, 2022
1 parent 331d02c commit 2b011fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/index.js
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/create-pull-request.ts
Expand Up @@ -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
Expand Down

0 comments on commit 2b011fa

Please sign in to comment.