Skip to content

Commit

Permalink
print repo
Browse files Browse the repository at this point in the history
  • Loading branch information
afujiwara-roblox committed Sep 29, 2023
1 parent f8060a3 commit 835e0cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ async function run(): Promise<void> {
).toLowerCase();

if (allowExternalGithubOrgs != "true") {
const repo = context.payload.repository;
if (repo == null) {
throw new Error(`Could not find repository`);
// const repo = new Context();
if (!process.env.GITHUB_REPOSITORY) {
throw new Error(`Could not find repository setup-foreman is running in`);
}
const org = repo.owner.name;
if (org == null) {
throw new Error(`Could not find owner of the repository. repo: ${JSON.stringify(repo)}`);
const repository = process.env.GITHUB_REPOSITORY.split('/');
if (repository.length == 0) {
throw new Error(`Could not find owner of repository setup-foreman is running in`)
}
const org = repository[0]
console.log(org);
configFile.checkSameOrgInConfig(org);
}

Expand Down

0 comments on commit 835e0cc

Please sign in to comment.