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

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-11-27 01:36:29 -07:00
committed by GitHub
parent c634be959b
commit da093c1609
3 changed files with 5 additions and 5 deletions

View File

@@ -184,7 +184,7 @@ export const getSHAForNonPullRequestEvent = async (
currentBranch = currentBranchName
}
if (previousSha && currentSha && currentBranch && targetBranch) {
if (inputs.baseSha && inputs.sha && currentBranch && targetBranch) {
if (previousSha === currentSha) {
core.error(
`Similar commit hashes detected: previous sha: ${previousSha} is equivalent to the current sha: ${currentSha}.`
@@ -405,7 +405,7 @@ export const getSHAForPullRequestEvent = async (
})
let diff = '...'
if (previousSha && currentSha && currentBranch && targetBranch) {
if (inputs.baseSha && inputs.sha && currentBranch && targetBranch) {
if (previousSha === currentSha) {
core.error(
`Similar commit hashes detected: previous sha: ${previousSha} is equivalent to the current sha: ${currentSha}.`