Skip to content

Commit

Permalink
fix: prevent similar commit hashes error when using the branch name (#…
Browse files Browse the repository at this point in the history
…1744)

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
jackton1 and actions-user authored Nov 27, 2023
1 parent 2139fa1 commit c634be9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/commitSha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}'...`)
Expand Down Expand Up @@ -434,7 +434,7 @@ export const getSHAForPullRequestEvent = async (
diff = '..'
}

if (!previousSha) {
if (!previousSha || previousSha === currentSha) {
if (inputs.sinceLastRemoteCommit) {
previousSha = github.context.payload.before

Expand Down

0 comments on commit c634be9

Please sign in to comment.