-
-
Notifications
You must be signed in to change notification settings - Fork 374
fix: Replace parse-git-config with ini + fs #1486
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
Conversation
@orta Can you please review this and approve it as soon as possible? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m positively disposed to this solution!
- The dependency it adds,
ini
, was already in ouryarn.lock
and is maintained by npm. - The code it adds is targeted and relatively straight-forward to read
- Note: I haven’t run this PR on my own system, but it looks good to me.
Thanks!
Aside: Seems like there’s a bit of faffing around with pre-commit/pre-push scripts, but I don’t use those, and the changes don’t look wrong, so that just looks irrelevant/fine.
You should remove the AI cruft before submitting this sort of thing. We don't need a comment on every line and the lint staging changes don't make sense. Otherwise, I think this is pretty reasonable, have you tested the command works locally? |
Thanks for the feedback! I've removed the excessive comments, and I’ve confirmed that |
I mean The lint staging changes shouldn't be there in this PR either - you're undoing a PR which was just merged #1483 |
…function for improved remote parsing
@orta Yes, I tested it, and the updated danger init logic works as expected both inside a Git repo and when run outside of one. I’ve also reverted the Husky related changes I had made earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace, thanks
@orta Thanks for the approval! can we release a new version for this? |
Fixes #1482
✨ Summary
This PR replaces
parse-git-config
with a combination of Node'sfs
module and theini
library for reading Git configuration, due to lack of support and known security vulnerabilities in the original library.📦 Changes Made
parse-git-config
withini + fs
get-repo-slug.ts
to manually read and parse.git/config
parse-git-config
inambient.d.ts
package.json
:parse-git-config
ini
🔒 Why this is needed
parse-git-config
is unmaintained and has known security issuesini + fs
gives better control and ensures future compatibility without relying on unmaintained dependencies🧪 Testing
.git/config
is correctly read and parsed📁 Affected Files
get-repo-slug.ts
ambient.d.ts
package.json
✅ Checklist