Skip to content

Commit

Permalink
chore: throw error if no owner is set
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Aug 18, 2024
1 parent b6b4f0e commit 0b2c0ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/helpers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ export async function isCiGreen({ octokit, logger, env }: Context, sha: string,
}
}

function parseTarget({ payload }: Context, target: string) {
const owner = payload.repository.owner?.login || "";
function parseTarget({ payload, logger }: Context, target: string) {
if (!payload.repository.owner) {
const errorMessage = "No repository owner has been found, the target cannot be parsed.";
logger.error(errorMessage);
throw new Error(errorMessage);
}
const owner = payload.repository.owner.login;
const [orgParsed, repoParsed] = target.split("/");
let repoTarget = null;
if (orgParsed !== owner) {
Expand Down

0 comments on commit 0b2c0ba

Please sign in to comment.