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

Changed files with git commands detects too many files #205

Open
mirpedrol opened this issue Oct 25, 2023 · 0 comments · May be fixed by #209
Open

Changed files with git commands detects too many files #205

mirpedrol opened this issue Oct 25, 2023 · 0 comments · May be fixed by #209

Comments

@mirpedrol
Copy link

Hello!

We are using this GitHub Action with the modification in #133 to avoid reaching the API Rate limit.
Using git commands, the action paths filter uses the command git rev-parse HEAD to obtain the last commit. In PR events, this is the pre merge commit id. Because of that, we see too many files changed, not only the ones in the current PR.

One solution is to use git rev-parse HEAD^2 instead, in order to obtain the real last commit from the PR branch.
In the GitHub workflow yaml file, the following must also be added:

- uses: actions/checkout@v4
        with:
          fetch-depth: 2 # To retrieve the preceding commit.

I'm happy to open a PR to address this if you think it's the right way to go :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant