From df996aa4b8b5d6bb08d5c63284c79f338c8ee360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8E=E5=A3=B0?= Date: Tue, 13 Aug 2024 14:58:15 +0800 Subject: [PATCH] fix: cannot release specific branch --- .eslintrc.js | 1 + src/github/service/opensumi.ts | 2 -- src/im/commands/opensumi.ts | 18 ++++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bc002701..4da408b6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { rules: { '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-explicit-any': 'warn', 'import/order': [ 'error', { diff --git a/src/github/service/opensumi.ts b/src/github/service/opensumi.ts index 0d5b0c5a..2010e63d 100644 --- a/src/github/service/opensumi.ts +++ b/src/github/service/opensumi.ts @@ -12,11 +12,9 @@ export class OpenSumiOctoService extends GitHubService { repo: string; }, branch: string, - workflowRef = 'main', ) { const workflow = await this.octo.actions.createWorkflowDispatch({ ...workflowInfo, - ref: workflowRef, inputs: { ref: branch, }, diff --git a/src/im/commands/opensumi.ts b/src/im/commands/opensumi.ts index add223b0..93486813 100644 --- a/src/im/commands/opensumi.ts +++ b/src/im/commands/opensumi.ts @@ -171,8 +171,6 @@ async function publishNextVersion( } if (payload.args['workflow-ref']) { workflowRef = payload.args['workflow-ref']; - } else { - workflowRef = ref; } } @@ -187,21 +185,21 @@ async function publishNextVersion( } const text = await app.opensumiOctoService.getLastNCommitsText({ owner: 'opensumi', - repo: repo, + repo, ref, }); const name = repo === 'core' ? 'OpenSumi' : 'CodeBlitz'; const workflowInfo = repo === 'core' - ? ActionsRepo.RELEASE_NEXT_BY_REF_WORKFLOW - : ActionsRepo.CODEBLITZ_RELEASE_NEXT_BY_REF_WORKFLOW; + ? { ...ActionsRepo.RELEASE_NEXT_BY_REF_WORKFLOW } + : { ...ActionsRepo.CODEBLITZ_RELEASE_NEXT_BY_REF_WORKFLOW }; - await app.opensumiOctoService.releaseNextVersion( - workflowInfo, - ref, - workflowRef, - ); + if (workflowRef) { + workflowInfo.ref = workflowRef; + } + + await app.opensumiOctoService.releaseNextVersion(workflowInfo, ref); await bot.reply( convertToDingMarkdown( `Releasing a next version of ${name}`,