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

Don’t run bypass-checks on non "run" actions #3644

Merged
merged 8 commits into from Oct 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/features/bypass-checks.tsx
Expand Up @@ -7,7 +7,13 @@ import * as api from '../github-helpers/api';
import {getRepoURL} from '../github-helpers';

async function bypass(detailsLink: HTMLAnchorElement): Promise<void> {
const runId = new URLSearchParams(detailsLink.search).get('check_run_id') ?? detailsLink.pathname.split('/').pop()!;
const [actionType, splitRunid] = detailsLink.pathname.split('/').splice(-2);
const runId = new URLSearchParams(detailsLink.search).get('check_run_id') ?? splitRunid;

if (!Number.parseInt(runId, 10) || actionType !== 'run') {
fregante marked this conversation as resolved.
Show resolved Hide resolved
return;
yakov116 marked this conversation as resolved.
Show resolved Hide resolved
}

const directLink = await api.v3(`repos/${getRepoURL()}/check-runs/${runId}`);
detailsLink.href = directLink.details_url;
}
Expand Down