Closed thearchitector closed 1 year ago
@thearchitector I believe that's by design If you'll like the changes to be detected based on a prior commit that has been pushed you can exclude since_last_remote_commit: "true"
When you say by design, which do you mean is the correct behavior?
It is interesting because if you change the action to be this instead:
- id: changed-files
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: "true"
dir_names: "true"
files_ignore: |
.github/**/*
it does seem to find the files.
The term "if there is no last remote commit, there are no changes"
might be a little confusing.
The design of since_last_remote_commit: "true"
main (A last commit) -- PR (B Initial commit)
Diff A and B (i.e all changed files between A and B)
PR (B last remote) -- PR (C-D-E-F pushed local commits)
Diff B and F (i.e all changed files between B and F)
NOTE: Any patterns you specify are matched if the pattern specified in the
files
list has been changed between B and F
You second comment
- id: changed-files
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: "true"
dir_names: "true"
files_ignore: |
.github/**/*
Uses the files_ignore
input which in this case means detecting changes to other files
That is what I thought, but I also assumed that this would also be the case:
main (A last commit)
PR (no last remote, doesn't exist) -- PR (B-C-D pushed local commits, creates remote branch)
Diff would be A and D
That is what I thought, but I also assumed that this would also be the case:
main (A last commit) PR (no last remote, doesn't exist) -- PR (B-C-D pushed local commits, creates remote branch)
Diff would be A and D
So do you mean you are seeing A compared to B as opposed to D ?
I am seeing C compared to D.
I've tested this thrice, but I will do it again because now I am doubting myself 😅
@jackton1 Tested again, and yes I am seeing C compared to D.
@thearchitector This should be resolved in the latest release.
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
If I push several commits to a new branch (as in, create a branch locally and commit several times, then
git push -u
), no changed files are detected if the last commit in the batch isn't an edit on any of those files (filtered by grep).If the flow of commits is this:
I should see
A compared to D
, but I actually seeC compared to D
. If none of the files matched by the grep were changed between C and D, nothing is picked up.To Reproduce
git checkout -b example
./example/banana
./example/pie
./README
git add example && git commit -m "match"
git add README && git commit -m "no match"
git push -u origin example
What OS are you seeing the problem on?
ubuntu-latest or ubuntu-20.04
Expected behavior?
Changes should be triggered for all the files matching the grep since the branch is new and
since_last_remote_commit = "true"
.If the flow of commits is this:
I should see
A compared to D
, and all matching files picked up by the action.Relevant log output
Anything else?
No response
Code of Conduct