Skip to content

Commit

Permalink
fix: add check for missing token input (peter-evans#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored and aleksandrychev committed Mar 4, 2024
1 parent dfafeeb commit 20f38cf
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 20f38cf

Please sign in to comment.