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

Github API reports 0 files changed on merge to main #81

Closed
sam-hoffman opened this issue Apr 9, 2021 · 4 comments · Fixed by #83
Closed

Github API reports 0 files changed on merge to main #81

sam-hoffman opened this issue Apr 9, 2021 · 4 comments · Fixed by #83
Labels
bug Something isn't working

Comments

@sam-hoffman
Copy link

sam-hoffman commented Apr 9, 2021

We have separate main and develop branches, and merge to main intermittently. On all merges to develop, the Github API reported changed files and the paths filter worked great.

On the merge to main, even though the PR page said 280 files were changed, the output from the paths filter said none were changed:
image

image

Ideally, I'd like these changed files to trigger tests. Any thoughts on what's going on here?

@dorny
Copy link
Owner

dorny commented Apr 9, 2021

Seems like a bug or some strange undocumented behavior on GitHub side.
This happened only once or every time you try to merge to main?
The 0 from Number of changed_files is 0 log line is taken directly from action event payload: github.context.payload.pull_request.changed_files

I'm using this number as limit in for loop while fetching files from API.
I could change it so it will always try to fetch files and will stop only if there are no more new files.
I'm not so happy about it - respecting the changed_files field feels like a proper implementation but who knows what's actually happening on GitHub side.

@dorny dorny added the bug Something isn't working label Apr 9, 2021
@sam-hoffman
Copy link
Author

We've only tried to merge to main once since I've added your filter to our PR tests (as you can see from the number of commits and files changed, lol)

I did try re-running the action but got the same outcome.

@dorny
Copy link
Owner

dorny commented Apr 11, 2021

Should be now fixed in versions v2 and v2.10.0.
If it still doesn't work for you please let me know and reopen this issue.

@dorny dorny closed this as completed Apr 11, 2021
@sam-hoffman
Copy link
Author

It worked! Thank you so much :)

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