mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-15 00:28:30 -05:00
v3.0.0 (#243)
* update major version --------- Co-authored-by: E Einowski <5124085+EwiththeBowtie@users.noreply.github.com> Co-authored-by: Max Zavodniuk <lovemaxonly@gmail.com> Co-authored-by: Malthe Poulsen <30603252+malpou@users.noreply.github.com> Co-authored-by: Sébastien Fichot <fichot.sebastien@gmail.com>
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { unlinkSync, writeFileSync } from 'fs';
|
||||
|
||||
import core from '@actions/core';
|
||||
import github from '@actions/github';
|
||||
import exec from '@actions/exec';
|
||||
import github from '@actions/github';
|
||||
import { intro, outro } from '@clack/prompts';
|
||||
import { PushEvent } from '@octokit/webhooks-types';
|
||||
|
||||
import { generateCommitMessageByDiff } from './generateCommitMessageFromGitDiff';
|
||||
import { sleep } from './utils/sleep';
|
||||
import { randomIntFromInterval } from './utils/randomIntFromInterval';
|
||||
import { unlinkSync, writeFileSync } from 'fs';
|
||||
import { sleep } from './utils/sleep';
|
||||
|
||||
// This should be a token with access to your repository scoped in as a secret.
|
||||
// The YML workflow will need to set GITHUB_TOKEN with the GitHub Secret Token
|
||||
@@ -133,6 +135,16 @@ async function improveCommitMessages(
|
||||
improvedMessagesWithSHAs
|
||||
);
|
||||
|
||||
// Check if there are actually any changes in the commit messages
|
||||
const messagesChanged = improvedMessagesWithSHAs.some(
|
||||
({ sha, msg }, index) => msg !== commitsToImprove[index].message
|
||||
);
|
||||
|
||||
if (!messagesChanged) {
|
||||
console.log('No changes in commit messages detected, skipping rebase');
|
||||
return;
|
||||
}
|
||||
|
||||
const createCommitMessageFile = (message: string, index: number) =>
|
||||
writeFileSync(`./commit-${index}.txt`, message);
|
||||
improvedMessagesWithSHAs.forEach(({ msg }, i) =>
|
||||
|
||||
Reference in New Issue
Block a user