-
-
Notifications
You must be signed in to change notification settings - Fork 192
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] Using the fork point to detect file changes. #355
Comments
This is expected based on actions/checkout#27, I'll recommend taking a look at actions/checkout#27 (comment) if you want to prevent files from showing up that were recently merged into the main branch You can reopen an issue on https://github.com/actions/checkout if you facing other issues related to the above. Thanks |
I am afraid that doesn't work: Here is failing run for Forked PR - it doesn't see this SHA: I think it may be actually a bug in this action as this SHA is pre-generated by this action: I am not passing it to |
@grzegorzkrukowski After testing this I found the source of the error and should be resolved in #358 |
Thanks @jackton1 - so now should I use my original version or one with ‘ref’ ? |
@grzegorzkrukowski It should be available in the latest release v14.6. |
Ok still - which version should be working now ? :) the one where I checkout merged commit or one with “ref” ? |
@grzegorzkrukowski You'll need to upgrade the action which fixes usage of merge commits - name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.6
|
Hey @jackton1 - I'm afraid it's still now working as it should: Here is a run using code from your last message: And here is a run when I tried to run with
https://github.com/raycast/extensions/runs/5185420161?check_suite_focus=true |
@grzegorzkrukowski The second job looks like a force push we nukes the commit hash and possibly leads to errors fetching the commit. I'll reopen this issue, as the test currently don't handle pull requests from forks and try to replicate the issue. |
Yes I am also looking into this problem. The weird thing I don't understand full is that:
I would expect it to be merged with |
I found something that maybe related to this issue: It seems like Which doesn't make any sense to me - I also send a support ticket to GitHub Support to get an answer for this one. |
@grzegorzkrukowski Just to confirm using ad-m/github-push-action#20 (comment) also doesn't solve the issue for you ?? |
@grzegorzkrukowski Can you outline the issue you faced using ? - name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v14.6
with:
base_sha: ${{ github.event.pull_request.head.sha }}
sha: ${{ github.event.sha }} |
@grzegorzkrukowski I stumbled upon a possible solution that might work but I’ll need your help in replicating the issue. Based on: #355 (comment)
But I'm unable to replicate more files showing up in the diff Possible resolution: |
Hey @jackton1 thanks for looking into this - let me see if I can reproduce it with your example |
@jackton1 I see you have been doing a lot of merges from main into your branch: When you look at our example - we don't really have merges - branch is never merged with main or rebased after its created. |
@grzegorzkrukowski This should be resolved using the See: https://github.com/tj-actions/changed-files/runs/5228672940?check_suite_focus=true |
@grzegorzkrukowski If you haven't already don't forget to star this project to help us reach a wider audience. Thanks |
Will do !! Thanks for your support ! Its one of the best axtions out there, couldnt live without it. |
Hit same issue as tj-actions/changed-files#355 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Hey @jackton1 I am afraid it doesn't work for some reason in our repository: It says about |
I’m guessing this is the link to the PR I’ll take a look at it this weekend. Something that stands out is the previous sha is unset which seems odd. This also occurs on a fork that is based on a different branch than main/master |
Thanks for looking into this so quickly! Yes, exactly that's the related PR. We haven't been using the |
Hey - any news on this one? I still couldn't figure out a proper way to make it work. |
@grzegorzkrukowski The bug has been fixed in the latest release v20 |
I am afraid I still cannot make it work... Here is the log from a failed job for one of my tries when using it: It says:
and I am fetching with fetch-depth: 0 :( |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
We are experience a weird behaviour of changed files being returned on Pull Requests.
You can find my workflow runs here:
https://github.com/raycast/extensions/runs/5148147932?check_suite_focus=true#step:3:107
https://github.com/raycast/extensions/runs/5149182650?check_suite_focus=true#step:3:107
Both of them runs on the same PR and against same
main
- the only different is that on main there were 2 commits added meanwhile I was testing it, you can see it here:Goal of our PRs is to validate files added by PR - I want to get files that were modified in PRs - only those files.
But from time to time we are getting weird combination of files coming from changes done on
main
branch like you can see in first workflow run above.Expected behaviour is to get just the list of changed files in given PR - so the correct one is the second run.
Our workflow is doing just this:
We have been playing with both:
and for some runs it helped, but it broke other PRs :/ it's a bit randomly behaving.
To Reproduce
main
are taken into account. Some commits on main can fix the problem or break it when you re-run existing checks on PRs.What OS are you seeing the problem on?
all
Expected behavior?
I would expect consistency.
Goal is to always get just changed files in PR - ignoring any changes that happened on main.
Relevant log output
Wrong:
https://github.com/raycast/extensions/runs/5148147932?check_suite_focus=true#step:3:107
Right:
https://github.com/raycast/extensions/runs/5149182650?check_suite_focus=true#step:3:107
Just re-runed after 2 commits were added.
Anything else?
All repositories and workflows are public.
We have more runs like this happening:
https://github.com/raycast/extensions/runs/5143485235?check_suite_focus=true
Not sure if that's happening because of forking or what's the problem - if we are doing something wrong in our workflows, please advice.
Code of Conduct
The text was updated successfully, but these errors were encountered: