Skip to content

Commit

Permalink
fix(merge-pr): support codeblitz
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Oct 9, 2024
1 parent fd11b33 commit ba0af0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/github/commands/pullRequests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,15 @@ Please see: <${getActionsUrl(ActionsRepo.BACKPORT_PR_WORKFLOW)}>`,
const { app, payload } = ctx;
const { issue } = payload;
const fullname = payload.repository.full_name;
const owner = payload.repository.owner.login;
const repo = payload.repository.name;
constraintRepo(fullname, mergeCommitAllowedRepo);
await checkIsPullRequestAndUserHasPermission(ctx, 'admin');

await app.octoService.createMergeCommitForPr({
pull_number: issue.number,
owner,
repo,
});
await app.createReactionForIssueComment(ctx, 'rocket');
},
Expand Down
8 changes: 7 additions & 1 deletion src/github/service/opensumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,17 @@ export class OpenSumiOctoService extends GitHubService {
return workflow;
}

async createMergeCommitForPr({ pull_number }: { pull_number: number }) {
async createMergeCommitForPr({
pull_number,
owner,
repo,
}: { pull_number: number; owner: string; repo: string }) {
const workflow = await this.octo.actions.createWorkflowDispatch({
...ActionsRepo.CREATE_MERGE_COMMIT_WORKFLOW,
inputs: {
pull_number: pull_number.toString(),
owner,
repo,
},
});
return workflow;
Expand Down

0 comments on commit ba0af0b

Please sign in to comment.