Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func init() {
scanCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
scanCmd.Flags().Bool("pipe", false, "scan input from stdin, ex: `cat some_file | infisical scan --pipe`")
scanCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
scanCmd.Flags().String("platform", "", "SCM platform to use for generating finding links (github, gitlab, azuredevops, bitbucket)")
Comment thread
adilsitos marked this conversation as resolved.

// global scan flags
scanCmd.PersistentFlags().StringP("config", "c", "", configDescription)
Expand Down Expand Up @@ -338,6 +339,13 @@ var scanCmd = &cobra.Command{
logging.Fatal().Err(err).Msg("could not create Git cmd")
}
scmPlatform = scm.UnknownPlatform
platformStr, _ := cmd.Flags().GetString("platform")
if platformStr != "" {
scmPlatform, err = scm.PlatformFromString(platformStr)
if err != nil {
log.Fatal().Err(err).Msg("invalid --platform value")
}
}
remote = detect.NewRemoteInfo(scmPlatform, source)

if findings, err = detector.DetectGit(gitCmd, remote); err != nil {
Expand Down
Loading