Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 committed Aug 14, 2023
1 parent 47e5c1a commit 1ab1c5c
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/deprecation-review-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ export async function addOrUpdateDeprecationReviewCheck(
`Validating ${pr.number} by ${pr.user.login}`,
);

const fork = pr.head.repo.fork;
const owner = pr.base.repo.owner.login;
const repo = pr.head.repo.name;

if (fork) {
if (pr.head.repo.fork) {
log(
'addOrUpdateDeprecationReviewCheck',
LogLevel.INFO,
Expand All @@ -46,16 +45,14 @@ export async function addOrUpdateDeprecationReviewCheck(
}

// Fetch the latest Deprecation Review check for the PR.
const checkRun = fork
? null
: (
await octokit.checks.listForRef({
ref: pr.head.sha,
per_page: 100,
owner,
repo,
})
).data.check_runs.find((run) => run.name === DEPRECATION_REVIEW_CHECK_NAME);
const checkRun = (
await octokit.checks.listForRef({
ref: pr.head.sha,
per_page: 100,
owner,
repo,
})
).data.check_runs.find((run) => run.name === DEPRECATION_REVIEW_CHECK_NAME);

const resetToNeutral = async () => {
if (!checkRun) return;
Expand All @@ -82,7 +79,6 @@ export async function addOrUpdateDeprecationReviewCheck(
return;
}


// Update the GitHub Check with appropriate deprecation review information.
const updateCheck = async (
opts: Omit<
Expand Down

0 comments on commit 1ab1c5c

Please sign in to comment.