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

Missing ability to add --logs-opts parameter #77

Open
Bl00D4NGEL opened this issue Feb 9, 2024 · 0 comments
Open

Missing ability to add --logs-opts parameter #77

Bl00D4NGEL opened this issue Feb 9, 2024 · 0 comments

Comments

@Bl00D4NGEL
Copy link

Bl00D4NGEL commented Feb 9, 2024

Is your feature request related to a problem? Please describe.
Gitleaks itself has an option to pass in log-opts to it's commands. This GH action is missing this configuration option

Quoted from https://github.com/gitleaks/gitleaks/blob/master/README.md#detect:

When running detect on a git repository, gitleaks will parse the output of a git log -p command (you can see how this executed [here](https://github.com/zricethezav/gitleaks/blob/7240e16769b92d2a1b137c17d6bf9d55a8562899/git/git.go#L17-L25)). 
[git log -p generates patches](https://git-scm.com/docs/git-log#_generating_patch_text_with_p) which gitleaks will use to detect secrets.
You can configure what commits git log will range over by using the --log-opts flag. --log-opts accepts any option for git log -p. 
For example, if you wanted to run gitleaks on a range of commits you could use the following command: gitleaks detect --source . --log-opts="--all commitA..commitB". 
See the git log [documentation](https://git-scm.com/docs/git-log) for more information.

Describe the solution you'd like
Being able to pass in log_opts or log-opts in the action configuration like this:

      ################
      # Run Gitleaks #
      ################
      - name: Run Gitleaks
        id: gitleaks
        uses: DariuszPorowski/github-action-gitleaks@v2
        with:
          log_opts: "my-branch --no-merges -p"

Describe alternatives you've considered
Currently one should be able to bypass this limitation by adding the log opts to the baseline_path like this: baseline_path: "${{ github.workspace }}/.gitleaks-baseline.json --log-opts='my-branch --no-merges -p'".

While this may work it's pretty ugly and only works in the main branch as this action already passes the log-opts when running inside a PR.

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

No branches or pull requests

1 participant