Skip to content
Closed
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Gitleaks Scan

on:
pull_request:
branches:
- main
- dev

jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With fetch-depth: 0 and no explicit “no-git/diff-only” mode, this is likely to scan full git history on every PR, which can be significantly slower and may surface unrelated historical findings. If the intent is to scan just the working tree for the PR, configure gitleaks accordingly and keep the checkout shallow to reduce runtime.

Suggested change
fetch-depth: 0
fetch-depth: 1

Copilot uses AI. Check for mistakes.
- uses: gitleaks/gitleaks-action@v2

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow runs gitleaks without referencing the repo’s existing gitleaks.toml / .gitleaksignore configuration, so allowlisted paths won’t be applied and results may differ from the existing nightly scan. Consider passing the config/ignore via the action inputs (or args) to ensure consistent findings across workflows.

Suggested change
- uses: gitleaks/gitleaks-action@v2
- uses: gitleaks/gitleaks-action@v2
with:
args: --config=.gitleaks.toml --gitleaks-ignore-path=.gitleaksignore

Copilot uses AI. Check for mistakes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions mock-secret.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Dòng này cố tình chứa secret giả để test Gitleaks trong quá trình làm đồ án
ghp_1234567890abcdefghijklmnopqrstuvwxyzabcd
Loading