mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
build
This commit is contained in:
@@ -27937,7 +27937,7 @@ async function improveCommitMessagesWithRebase(commits, diffs) {
|
||||
ce("Done.");
|
||||
}
|
||||
async function improveMessagesInChunks() {
|
||||
const chunkSize = 1;
|
||||
const chunkSize = diffs.length % 2 === 0 ? 4 : 3;
|
||||
ce(`Improving commit messages with GPT in chunks of ${chunkSize}.`);
|
||||
const improvePromises = diffs.map(
|
||||
(commit) => generateCommitMessageByDiff(commit.diff)
|
||||
@@ -28003,13 +28003,17 @@ async function run(retries = 3) {
|
||||
if (import_github.default.context.eventName === "pull_request") {
|
||||
const baseBranch = import_github.default.context.payload.pull_request?.base.ref;
|
||||
const sourceBranch = import_github.default.context.payload.pull_request?.head.ref;
|
||||
ce("Pull Request opened");
|
||||
ce(
|
||||
`Pull Request from source: (${sourceBranch}) to base: (${baseBranch})`
|
||||
);
|
||||
if (import_github.default.context.payload.action === "opened")
|
||||
ce(`Pull Request opened from ${sourceBranch} to ${baseBranch}`);
|
||||
ce("Pull Request action: opened");
|
||||
else if (import_github.default.context.payload.action === "synchronize")
|
||||
ce("New commits are pushed");
|
||||
ce("Pull Request action: synchronize");
|
||||
else
|
||||
return ce("Unhandled action: " + import_github.default.context.payload.action);
|
||||
return ce(
|
||||
"Pull Request unhandled action: " + import_github.default.context.payload.action
|
||||
);
|
||||
const payload = import_github.default.context.payload;
|
||||
const commitsResponse = await octokit.rest.pulls.listCommits({
|
||||
owner,
|
||||
|
||||
@@ -73,7 +73,7 @@ async function improveCommitMessagesWithRebase(
|
||||
|
||||
// send chunks of diffs in parallel, because openAI restricts too many requests at once with 429 error
|
||||
async function improveMessagesInChunks() {
|
||||
const chunkSize = 1;
|
||||
const chunkSize = diffs!.length % 2 === 0 ? 4 : 3;
|
||||
outro(`Improving commit messages with GPT in chunks of ${chunkSize}.`);
|
||||
const improvePromises = diffs!.map((commit) =>
|
||||
generateCommitMessageByDiff(commit.diff)
|
||||
@@ -166,13 +166,17 @@ async function run(retries = 3) {
|
||||
if (github.context.eventName === 'pull_request') {
|
||||
const baseBranch = github.context.payload.pull_request?.base.ref;
|
||||
const sourceBranch = github.context.payload.pull_request?.head.ref;
|
||||
outro('Pull Request opened');
|
||||
|
||||
outro(
|
||||
`Pull Request from source: (${sourceBranch}) to base: (${baseBranch})`
|
||||
);
|
||||
if (github.context.payload.action === 'opened')
|
||||
outro(`Pull Request opened from ${sourceBranch} to ${baseBranch}`);
|
||||
outro('Pull Request action: opened');
|
||||
else if (github.context.payload.action === 'synchronize')
|
||||
outro('New commits are pushed');
|
||||
else return outro('Unhandled action: ' + github.context.payload.action);
|
||||
outro('Pull Request action: synchronize');
|
||||
else
|
||||
return outro(
|
||||
'Pull Request unhandled action: ' + github.context.payload.action
|
||||
);
|
||||
|
||||
const payload = github.context.payload as PullRequestEvent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user