Skip to content

Commit

Permalink
some error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mukunku authored Sep 17, 2023
1 parent bc597bd commit 9093bf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ async function run() {

console.log(`Searching for tag: ${tag} in ${repoInput}`);

if (!repoInput.contains('/')) {
throw new Error(`${repoInput} is not a valid repo`);
}

// Get owner and repo from context of payload that triggered the action
const [ owner, ...repository ] = repoInput.split('/');
const repo = repository.join('/');
Expand Down Expand Up @@ -38,4 +42,4 @@ async function run() {
}
}

run();
run();

0 comments on commit 9093bf8

Please sign in to comment.