Skip to content

Commit

Permalink
security check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jet Xu committed May 16, 2024
1 parent 70b27ae commit c418c9f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
title = "gitleaks config"

[[rules]]
description = "OpenAI API Key"
regex = '''sk-[a-zA-Z0-9]{32}'''
tags = ["apikey"]

[[rules]]
description = "Hugging Face Token"
regex = '''hf_[a-zA-Z0-9]{40}'''
tags = ["apikey"]

[[rules]]
description = "GitHub Token"
regex = '''ghp_[a-zA-Z0-9]{36}'''
tags = ["apikey"]
18 changes: 18 additions & 0 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Secret Scan

on: [push, pull_request]

jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Gitleaks
run: |
curl -sSL https://github.com/zricethezav/gitleaks/releases/download/v8.2.0/gitleaks_8.2.0_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks
- name: Run Gitleaks
run: |
gitleaks detect --source . --config-path .github/gitleaks.toml

0 comments on commit c418c9f

Please sign in to comment.