feat(scan): add --platform flag for self-hosted SCM link generation#294
feat(scan): add --platform flag for self-hosted SCM link generation#294devin-ai-integration[bot] wants to merge 1 commit into
Conversation
The scan command logs 'Use --platform to include links in findings' when it cannot auto-detect the SCM platform from the remote hostname, but the flag was never actually registered. This adds the missing --platform flag so users with self-hosted Git instances (e.g. gitlab.uhlhost.net) can explicitly specify their platform to get clickable links in findings. Accepted values: github, gitlab, azuredevops, bitbucket Co-Authored-By: arsh <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
| Filename | Overview |
|---|---|
| packages/cmd/scan.go | Adds --platform flag to scanCmd, reads it before calling detect.NewRemoteInfo, and converts the string to a scm.Platform enum via PlatformFromString; logic is correct and error-handling follows existing file patterns. |
Reviews (1): Last reviewed commit: "feat(scan): add --platform flag for self..." | Re-trigger Greptile
adilsitos
left a comment
There was a problem hiding this comment.
it seems to be disabled on purpose.
|
This code is forked from gitleaks which does have the If it was intentionally disabled, should we update the log message to remove the |
Summary
The
infisical scancommand logs"Unknown SCM platform. Use --platform to include links in findings."when it cannot auto-detect the SCM platform from the remote hostname (e.g. self-hosted GitLab atgitlab.uhlhost.net), but the--platformflag was never actually registered on the command — resulting inError: unknown flag: --platformwhen users follow the suggestion.This PR adds the missing
--platformflag toscanCmd:Accepted values:
github,gitlab,azuredevops,bitbucket. When specified, the platform is passed todetect.NewRemoteInfoinstead of always usingscm.UnknownPlatform, enabling link generation for findings on self-hosted instances.Link to Devin session: https://app.devin.ai/sessions/38383a02822246a391f66366f48f27e0
Requested by: @0xArshdeep