Skip to content

Commit

Permalink
fix: cannot release specific branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Aug 13, 2024
1 parent e52a6fe commit df996aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
2 changes: 0 additions & 2 deletions src/github/service/opensumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
18 changes: 8 additions & 10 deletions src/im/commands/opensumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ async function publishNextVersion(
}
if (payload.args['workflow-ref']) {
workflowRef = payload.args['workflow-ref'];
} else {
workflowRef = ref;
}
}

Expand All @@ -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}`,
Expand Down

0 comments on commit df996aa

Please sign in to comment.