3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-29 13:34:51 +00:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

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}.`