Skip to content
Draft
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
40 changes: 40 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Secret scan: fails a PR (and comments on it) when a commit adds a key, token or password.
#
# This repository is public, so it cannot call the org's shared workflow in the private
# Blockworks-Projects/workflows repository. This is a standalone copy of that workflow's scan job;
# keep the pinned versions in step with Blockworks-Projects/workflows/.github/workflows/gitleaks.yml.
#
# A finding means the secret is compromised even if the commit is reverted: rotate it first, then remove it.
# Allowlist a false positive in a gitleaks.toml at the repo root (gitleaks reads it automatically).

name: Secret scan

on:
pull_request:
push:
branches: [main]

permissions: {}

jobs:
gitleaks:
name: gitleaks
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read # clone the repository
pull-requests: write # comment on the PR when a secret is found
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0 # full history, so every commit in the event range is available

- name: Scan for secrets
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} # organisation secret
GITLEAKS_ENABLE_COMMENTS: "true"
GITLEAKS_ENABLE_SUMMARY: "true"
GITLEAKS_ENABLE_UPLOAD_ARTIFACT: "true"
Loading