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 committed Jul 17, 2023
1 parent ba65033 commit 8d52593
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

2 comments on commit 8d52593

@vercel
Copy link

@vercel vercel bot commented on 8d52593 Jul 17, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ledger-live-github-bot – ./tools/github-bot

ledger-live-github-bot-git-develop-ledgerhq.vercel.app
ledger-live-github-bot.vercel.app
ledger-live-github-bot-ledgerhq.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8d52593 Jul 17, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.