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

[BUG] Unable find a diff between ... #944

Closed
3 tasks done
djfinnoy opened this issue Jan 11, 2023 · 4 comments · Fixed by #945
Closed
3 tasks done

[BUG] Unable find a diff between ... #944

djfinnoy opened this issue Jan 11, 2023 · 4 comments · Fixed by #945
Labels
bug Something isn't working

Comments

@djfinnoy
Copy link

djfinnoy commented Jan 11, 2023

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?

After bumping from v34.6.2 to v35.4.0, I'm running into an issue where the workflow is throwing the following error:

Unable find a diff between 52c498ad5ed2b170c9b6f93f9cb17ef28475ff77 and 803d95dca26b8e7c5143fb8c246252c0d2c61085

However, there are actually differences between these commits. Since this is from a private repository, I can only provide a screenshot as proof:
image

When I roll back to v34.6.2 , the problem disappears.

I think my use case is a little bit unusual; I need to compare the head branch of a pull request, with the base branch at the time when the pull request was created. If I were to omit base_sha from the reproducible example below, the differences get polluted by commits to the base branch that are not related to the pull request.

To Reproduce

name: example

on:
  pull_request: {}

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.base.sha }}
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - id: changed-files
        uses: tj-actions/changed-files@v35.4.0
        with:
          sha: ${{ github.event.pull_request.head.sha }}
          base_sha: ${{ github.event.pull_request.base.sha }}
          json: true

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

I expect differences to be detected, and for the workflow to function normally with the given inputs.

Relevant log output

<deleted>

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@djfinnoy djfinnoy added the bug Something isn't working label Jan 11, 2023
@jackton1
Copy link
Member

jackton1 commented Jan 11, 2023

@djfinnoy The log output seems to be missing some key information and I noticed you are using the checkout action twice have to tried using it once.

@djfinnoy
Copy link
Author

djfinnoy commented Jan 11, 2023

When closing a pull request, the HEAD branch gets deleted, therefor, using fetch-depth: 0 leads to an error where the head commit is not present. Using it twice is the only workaround I am aware of that allows me to capture both the relevant commits.

I'll edit the first post to include the missing log lines.

@jackton1
Copy link
Member

jackton1 commented Jan 11, 2023

@djfinnoy This should be resolved in the latest release

@djfinnoy
Copy link
Author

Indeed, it's working now. Thank you very much for the swift resolution.

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

Successfully merging a pull request may close this issue.

2 participants