fix: prevent similar commit hashes error when using the branch name (#1744)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack 2023-11-27 00:54:44 -07:00 committed by GitHub
parent 2139fa1b6f
commit c634be959b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

4
dist/index.js generated vendored
View File

@ -1012,7 +1012,7 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
diff
};
}
if (!previousSha) {
if (!previousSha || previousSha === currentSha) {
core.debug('Getting previous SHA...');
if (inputs.since) {
core.debug(`Getting base SHA for '${inputs.since}'...`);
@ -1199,7 +1199,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
((_u = (_t = github.context.payload.head) === null || _t === void 0 ? void 0 : _t.repo) === null || _u === void 0 ? void 0 : _u.fork) === 'true') {
diff = '..';
}
if (!previousSha) {
if (!previousSha || previousSha === currentSha) {
if (inputs.sinceLastRemoteCommit) {
previousSha = github.context.payload.before;
if (!previousSha ||

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -206,7 +206,7 @@ export const getSHAForNonPullRequestEvent = async (
}
}
if (!previousSha) {
if (!previousSha || previousSha === currentSha) {
core.debug('Getting previous SHA...')
if (inputs.since) {
core.debug(`Getting base SHA for '${inputs.since}'...`)
@ -434,7 +434,7 @@ export const getSHAForPullRequestEvent = async (
diff = '..'
}
if (!previousSha) {
if (!previousSha || previousSha === currentSha) {
if (inputs.sinceLastRemoteCommit) {
previousSha = github.context.payload.before