Skip to content

fix(script-tool): force color off in captured script output (deterministic) #502

fix(script-tool): force color off in captured script output (deterministic)

fix(script-tool): force color off in captured script output (deterministic) #502

name: security-secrets
on:
push:
branches: [main]
paths:
- "packages/**"
- "apps/**"
- "scripts/**"
- ".gitleaks.toml"
- ".github/workflows/security-secrets.yml"
pull_request:
branches: [main]
schedule:
- cron: "17 6 * * 1"
concurrency:
group: security-secrets-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
security-events: write
pull-requests: read
jobs:
gitleaks:
name: gitleaks secret scan
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
GITLEAKS_VERSION: "8.30.1"
GITLEAKS_SHA256: "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Detect relevant changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: |
code:
- 'packages/**'
- 'apps/**'
- 'scripts/**'
- '.gitleaks.toml'
- '.github/workflows/security-secrets.yml'
- name: Install gitleaks CLI
if: steps.filter.outputs.code == 'true'
run: |
set -euo pipefail
TARBALL="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
curl -sSL -o "/tmp/${TARBALL}" \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${TARBALL}"
echo "${GITLEAKS_SHA256} /tmp/${TARBALL}" | sha256sum -c -
tar -xzf "/tmp/${TARBALL}" -C /tmp
sudo mv /tmp/gitleaks /usr/local/bin/
gitleaks version
- name: Scan
if: steps.filter.outputs.code == 'true'
run: |
gitleaks detect \
--source . \
--config .gitleaks.toml \
--no-banner \
--redact \
--verbose \
--report-format=sarif \
--report-path=gitleaks-results.sarif \
--exit-code=1
- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@7c1e4cf0b20d7c1872b26569c00ba908797a59bf # v4
with:
sarif_file: gitleaks-results.sarif
category: gitleaks
continue-on-error: true