mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-06 09:41:22 +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:
parent
c634be959b
commit
da093c1609
3 changed files with 5 additions and 5 deletions
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
|
@ -997,7 +997,7 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
|||
targetBranch = currentBranchName;
|
||||
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}.`);
|
||||
core.error(`Please verify that both commits are valid, and increase the fetch_depth to a number higher than ${inputs.fetchDepth}.`);
|
||||
|
@ -1180,7 +1180,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||
token: inputs.token
|
||||
});
|
||||
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}.`);
|
||||
core.error(`Please verify that both commits are valid, and increase the fetch_depth to a number higher than ${inputs.fetchDepth}.`);
|
||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -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}.`
|
||||
|
|
Loading…
Add table
Reference in a new issue