Skip to content

Commit

Permalink
chore(bot): remove extra input in command
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman authored and hakim-adamik committed Jul 21, 2023
1 parent 17bf393 commit 7c07c02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tools/github-bot/src/commands/full-suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ const ACTION_ID = "lld_full_suite";
export function runDesktopTestSuite(app: Probot) {
async function triggerWorkflow({
context,
number,
login,
full,
}: {
context: Context<"issue_comment.created" | "check_run.requested_action">;
number: string;
login: string;
full?: boolean;
}) {
Expand All @@ -40,40 +38,35 @@ export function runDesktopTestSuite(app: Probot) {
workflow_id: "test-desktop.yml",
ref,
inputs: {
number,
login,
// @ts-expect-error weird behavior with boolean values
"full-tests": full,
},
});
}

commands(app, "full-lld-tests", async (context, data) => {
commands(app, "full-lld-tests", async (context, _data) => {
const { payload } = context;

if (context.isBot) return;

await triggerWorkflow({
context,
number: `${data.number}`,
login: `${payload.comment.user.login}`,
full: true,
});
});

// @ts-expect-error ts pls
app.on("check_run.requested_action", async context => {
const { payload } = context;

if (payload.requested_action.identifier !== ACTION_ID) return;

const number = payload.check_run.pull_requests[0]?.number;
const login = payload.sender.login;

if (!number) return;

await triggerWorkflow({
context,
number: `${number}`,
login,
full: true,
});
Expand Down
2 changes: 2 additions & 0 deletions tools/github-bot/src/commands/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const commands = (
const { payload, octokit } = context;
const isPR = (issue: any) => issue.pull_request !== undefined;

context.log.info(`[⚙️ Commands](issue_comment.created) PR #${payload.issue.number}`);

const issue = payload.issue;
const comment = payload.comment;
const command = comment.body.match(matcher);
Expand Down

0 comments on commit 7c07c02

Please sign in to comment.