Skip to content

feat(lint): scan PR commits on PRs and full history privately via code scanning #520

Closed

Description

@DevSecNinja

The owner's direction (2026-11-16), replacing #505's PR-annotation approach for history findings:

1. PR runs: gitleaks scans only the PR's own commits (gitleaks git --log-opts "<base>..<head>", or the official gitleaks-action, which does this). A secret added in a PR fails that PR. Old history findings never show up on unrelated PRs.

2. History scan, private: on push to the default branch, a weekly schedule and manual dispatch, gitleaks scans the full history with the current rules. The gitleaks version is Renovate-managed, so new detection rules get applied to old commits too.

  • Public repos: upload --report-format sarif to code scanning under a category such as gitleaks/history. The Security tab alert list needs write access, so only the owner sees the findings. Because these aren't PR runs, there are no PR annotations. Job logs on public repos are public, so the log shows a count only: no file, line, commit or summary table, and no artifact (any signed-in user can download artifacts on public repos).
  • Private repos (Free plan, no code scanning): put the findings in the job summary and log, which only collaborators can see.
  • Whether the history scan should fail the run or only report is open. Probably report only, so findings get triaged as alerts and dismissed there (false positive or test value).

3. Remove or limit #505's PR annotations, summary and artifact so they only cover findings from the PR's own commits.

Hold the v3.8.0 release (#516) until this is in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions