-
-
Notifications
You must be signed in to change notification settings - Fork 202
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] pull request with since_last_remote_commit = true
returns fatal: bad object
#253
Comments
@solarmosaic-kflorence You might be missing |
Hm, thanks @jackton1 it does work with |
This works: steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
ref: "${{ github.event.pull_request.head.sha }}"
- run: git fetch --prune --progress --depth=1 origin ${{ github.event.before }}
- id: changed-files
uses: tj-actions/changed-files@aae164d51be780a235cdeea89752bbacbbfee3c3
with:
files: |
^${{ env.PROJECT_PATH }}
sha: "${{ github.event.pull_request.head.sha }}"
since_last_remote_commit: "true" |
In some cases, I think I don't even need the |
Okay would remove the redundant pulling of the remote branch. Thanks |
Thanks @jackton1 for your always speedy responses, it's appreciated :) |
@solarmosaic-kflorence No worries, I've made the change to use a shallow history of the last commit on the remote branch, which should be available in the latest release. |
Confirmed the fix works, thanks! |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
The action is not able to locate the last remote commit on the pull-request.
To Reproduce
Here is the action YAML:
When this workflow is executed, it results in several
fatal: bad object 9b20d537dc9a0943ad43cd8e6a08c444640a75e3
errors, and all outputs are blank. That commit SHA is correct -- it was the last remote commit on the pull-request branch. It also returns the correct commit SHA if there are multiple commits pushed at the same time.What OS are you seeing the problem on?
ubuntu-latest or ubuntu-20.04
Expected behavior?
I expect the action to provide a diff of files between the last remote commit on the pull-request (which it correctly figures out) and the HEAD commit of the pull-request (the last commit that was pushed -- which I have confirmed in the output is also correct). Perhaps the base ref needs to be explicitly fetched from the remote in order for it to be found.
Relevant log output
Anything else?
As an aside, this logging can be misleading:
Since the
X
commit may not be from master.Code of Conduct
The text was updated successfully, but these errors were encountered: