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

Gitleaks action fails when creating PR in new repo #58

Closed
lawndoc opened this issue Oct 25, 2022 · 3 comments · Fixed by #62
Closed

Gitleaks action fails when creating PR in new repo #58

lawndoc opened this issue Oct 25, 2022 · 3 comments · Fixed by #62
Assignees
Labels
bug Something isn't working

Comments

@lawndoc
Copy link
Collaborator

lawndoc commented Oct 25, 2022

On this line, the command passed to gitleaks for PRs compares with ^.. which will reference the previous commit on the base branch. This causes Gitleaks to reference a commit that doesn't exist when running on a PR for a repo with only one commit in the base branch.

Is there a reason this isn't .. instead? Would it cause any issues to change this?

Not a widely impactful bug, but I just want to understand what the intended behavior is in case I'm missing something.

@lawndoc lawndoc changed the title Gitleaks action fails when running in new repo Gitleaks action fails when creating PR in new repo Oct 25, 2022
@DariuszPorowski DariuszPorowski self-assigned this Oct 26, 2022
@lawndoc
Copy link
Collaborator Author

lawndoc commented Nov 23, 2022

@DariuszPorowski just checking in. Is including ^ before .. important to the functionality of the tool when comparing pull requests? It seems to me like it wouldn't be an issue to remove the ^, but I just want to make sure I'm not missing something before I create a PR.

@lawndoc lawndoc added the bug Something isn't working label Feb 7, 2023
@lawndoc
Copy link
Collaborator Author

lawndoc commented Feb 7, 2023

I'll test this while I'm working on #61

@lawndoc lawndoc self-assigned this Feb 7, 2023
@lawndoc
Copy link
Collaborator Author

lawndoc commented Feb 8, 2023

Looks like using ... instead of ^.. in the git log args will fix the issue with no negative side effects.

Brand new repo with ^.. for git log arg:

image

Same new repo with ... for git log arg:

image

Existing repo with ... for git log arg:

image

I'll include this fix in my merge along with the fix for #61

@lawndoc lawndoc linked a pull request Feb 8, 2023 that will close this issue
DariuszPorowski pushed a commit that referenced this issue Feb 8, 2023
Closes major bug #61 and minor bug #58
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