Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use API for bypass-checks #3629

Merged
merged 10 commits into from Oct 9, 2020
Merged

Use API for bypass-checks #3629

merged 10 commits into from Oct 9, 2020

Conversation

yakov116
Copy link
Member

@yakov116 yakov116 commented Oct 7, 2020

@fregante
Copy link
Member

fregante commented Oct 7, 2020

🔥

@yakov116 yakov116 marked this pull request as ready for review October 7, 2020 21:32
@yakov116

This comment has been minimized.

detailsLink.href,
'[data-hydro-click*="check_suite.external_click"]'
);
const getDirectLink = mem(async (runId: number): Promise<string> => {
Copy link
Member

@fregante fregante Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API is already memoized, no need to do it again. You can probably just inline it like it was

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be removed from there too. It would only make sense if it saved heavy operations (e.g. HTTP requests), but what follows is just a few conditions.

@sindresorhus sindresorhus changed the title Use api for bypass-checks Use API for bypass-checks Oct 8, 2020
detailsLink.href = directLink.href;
}
const runId = new URLSearchParams(detailsLink.search).get('check_run_id') ?? detailsLink.pathname.split('/').pop();
const directLink = await api.v3(`repos/${getRepoURL()}/check-runs/${Number(runId)}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why number? It goes into a string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I have no idea why I did that!

@yakov116 yakov116 merged commit ac32e2c into master Oct 9, 2020
@yakov116 yakov116 deleted the Use_api_bypass_checks branch October 9, 2020 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants