Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Similar commit hash detected. You seem to be missing fetch-depth:0 #656

Closed
3 tasks done
aseem-heg opened this issue Sep 29, 2022 · 3 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@aseem-heg
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

I deploy branch1 to master, then immediately I rebase branch2 on master and deploy branch2 to master.
Both deployments have GHA functionality where they check for file changes using this GHA changed-files functionality.
I have set fetch-depth: 0

branch1 always gets error - Similar commit hash detected. screen shot attached
Screenshot from 2022-09-28 23-40-40

Observations:

  • This runs fine when just 1 branch is deployed to master at a time.
  • When I rerun failed job manually - it works fine without having to rebase or modify this branch.

To Reproduce

Create branch1 from master.
Then create branch2 from master.
Add some unique changes to both branches.
Write some GHA code job as below:

jobs:
  seed_data_changed:
    name: Check if seed data files changed
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0 # fetch all history of all branches

      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@v29

Deploy branch1. Then immediately deploy branch 2. Assuming there is no conflict.
When both branches have changed-files running simultaneously on them - we get this error

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

No error should be shown.
We should see file changes as usual.

Relevant log output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@aseem-heg aseem-heg added the bug Something isn't working label Sep 29, 2022
@jackton1
Copy link
Member

jackton1 commented Sep 29, 2022

@aseem-heg Can you upgrade to v31 and verify that the issue persists ?

@aseem-heg
Copy link
Author

  • this library is trying to get changed file names between
    • Pushed commit: commit that triggered this workflow on gha
    • 2nd commit from head of the branch.
  • Since I immediately push another commit to dev branch before this first commits workflow to check file-changed starts - we see that both SHA are same for git diff
    • git diff commit_2 commit_2

Hence we get this error.

@jackton1
Copy link
Member

jackton1 commented Sep 30, 2022

I’ll suggest reproducing the bug in the latest release and open a new issue if it persists.

@jackton1 jackton1 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants