Skip to content

Commit e60c46a

Browse files
committed
chore: scrub upstream-notify.yml + add gitleaks allowlist for placeholders
upstream-notify.yml: - runs-on: self-hosted -> ubuntu-latest. The job only calls the gh CLI to upsert an issue; no internal resources needed. Removes the self-hosted-runner disclosure and frees those minutes for jobs that actually need self-hosted. - Drop the comment about "185 unread tickets between Feb 18 and Mar 19, 2026" — operational anecdote, not useful to a public reader. .gitleaks.toml: - New file. Extends gitleaks default rules with a tight allowlist for documented placeholder values (sk_live_xxx, sk_live_your_key, YOUR_API_KEY, ${VAR_NAME}, etc.) that appear in curl examples, OpenAPI/AsyncAPI specs, and llms-full.txt. Suppresses the 150 known benign findings while keeping real-looking tokens flagged — verified by injecting a fake sk_live_realLookingToken1234567890 and confirming it's still caught.
1 parent 3e6e6be commit e60c46a

2 files changed

Lines changed: 40 additions & 8 deletions

File tree

.github/workflows/upstream-notify.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Handle Upstream API Endpoint Change
22

3-
# Receives `repository_dispatch` events from upstream repos (sharp-api-go)
4-
# when handler files change. Dedups to ONE rolling open issue per UTC day —
5-
# subsequent dispatches the same day append a comment instead of opening a
6-
# new issue. This bounds noise at ≤1 new issue/day even at firehose rates.
7-
#
8-
# Earlier version (pre-2026-05) opened a fresh issue per dispatch, which
9-
# produced 185 unread tickets between Feb 18 and Mar 19, 2026.
3+
# Receives `repository_dispatch` events from upstream repos when handler
4+
# files change. Dedups to ONE rolling open issue per UTC day — subsequent
5+
# dispatches the same day append a comment instead of opening a new issue.
6+
# This bounds noise at ≤1 new issue/day even at firehose rates.
107

118
on:
129
repository_dispatch:
@@ -18,7 +15,7 @@ permissions:
1815

1916
jobs:
2017
upsert-review-issue:
21-
runs-on: self-hosted
18+
runs-on: ubuntu-latest
2219
timeout-minutes: 5
2320

2421
steps:

.gitleaks.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Gitleaks config — extends the default rule set with allowlists for
2+
# documented placeholder values. Real secrets are still caught.
3+
#
4+
# Run locally: gitleaks git --redact=0 --log-level warn
5+
# CI: any standard gitleaks-action invocation will read this file.
6+
7+
[extend]
8+
useDefault = true
9+
10+
[[allowlists]]
11+
description = "Documentation placeholders — these strings appear in code samples and API examples and are intentionally never real keys."
12+
regexes = [
13+
# SharpAPI key placeholders used throughout the docs and OpenAPI spec
14+
'''sk_live_(your_key|xxx|abc123def456|REDACTED|\.\.\.)\b''',
15+
'''sk_test_(pro|hobby|sharp|free|your_key|xxx)\b''',
16+
'''sharpapi_(new|rotated)[a-z0-9]{20,40}''',
17+
# Generic placeholders
18+
'''YOUR_API_KEY''',
19+
'''<YOUR_[A-Z_]+>''',
20+
]
21+
22+
[[allowlists]]
23+
description = "curl-auth-header false positives in docs — fires on placeholder credentials only. A curl line containing a real-looking token (e.g. sk_live_[A-Za-z0-9]{20,}) is NOT matched here and will still be flagged."
24+
paths = [
25+
'''content/.+\.mdx$''',
26+
'''public/llms-full\.txt$''',
27+
'''public/openapi\.json$''',
28+
'''public/asyncapi\.yaml$''',
29+
]
30+
regexTarget = "match"
31+
regexes = [
32+
'''X-API-Key:\s*(sk_live_(your_key|xxx|\.\.\.|REDACTED)|sk_test_(pro|hobby|sharp|free|xxx)|YOUR_API_KEY|\$\{?[A-Z_]+\}?)''',
33+
'''Authorization:\s*Bearer\s+(sk_live_(your_key|xxx|\.\.\.|REDACTED)|YOUR_API_KEY|\$\{?[A-Z_]+\}?)''',
34+
'''api_key=(sk_live_(your_key|xxx|\.\.\.|REDACTED)|YOUR_API_KEY|\$\{?[A-Z_]+\}?)''',
35+
]

0 commit comments

Comments
 (0)