Skip to content

Commit c634be9

Browse files
fix: prevent similar commit hashes error when using the branch name (#1744)
Co-authored-by: GitHub Action <action@github.com>
1 parent 2139fa1 commit c634be9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commitSha.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const getSHAForNonPullRequestEvent = async (
206206
}
207207
}
208208

209-
if (!previousSha) {
209+
if (!previousSha || previousSha === currentSha) {
210210
core.debug('Getting previous SHA...')
211211
if (inputs.since) {
212212
core.debug(`Getting base SHA for '${inputs.since}'...`)
@@ -434,7 +434,7 @@ export const getSHAForPullRequestEvent = async (
434434
diff = '..'
435435
}
436436

437-
if (!previousSha) {
437+
if (!previousSha || previousSha === currentSha) {
438438
if (inputs.sinceLastRemoteCommit) {
439439
previousSha = github.context.payload.before
440440

0 commit comments

Comments
 (0)