Skip to content

Commit 2188fd7

Browse files
committed
ci: add hidden-unicode lint via weaviate/weaviate composite
Delegates the trojan-source / hidden-unicode scan to the weaviate/weaviate/.github/actions/security-lint composite action shipped in weaviate/weaviate#11093, pinned to its merge commit (3e52fc80a244f4644d4facc6a4e705ea6eda9039). Uses pull_request_target so the workflow definition runs from the base branch and PR-controlled refs are never executed; the composite fetches the diff via the GitHub API.
1 parent b00cb9a commit 2188fd7

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PR Security Lint
2+
3+
# SECURITY: This workflow uses pull_request_target intentionally so that the
4+
# workflow definition runs from the BASE branch (main), not the PR. The
5+
# composite action it invokes lives at a pinned 40-char SHA in
6+
# weaviate/weaviate — attackers cannot alter the lint logic via a PR or by
7+
# tampering with an upstream tag.
8+
#
9+
# Rules:
10+
# 1. Do NOT add `ref: ${{ github.event.pull_request.head.sha }}` or any
11+
# reference to PR-controlled refs. The composite uses the GitHub API to
12+
# fetch the diff text — no PR code is ever executed.
13+
# 2. Do NOT add secrets to this workflow. The pull_request_target context
14+
# grants a token with write access to the base repo and access to all
15+
# repo secrets if any are referenced. We reference none and request
16+
# minimal permissions; keep it that way.
17+
# 3. Keep the composite action pinned to a full-length commit SHA. Tag or
18+
# branch refs would let an upstream change alter the lint logic at
19+
# execution time.
20+
on:
21+
pull_request_target:
22+
23+
permissions: {}
24+
25+
jobs:
26+
hidden-unicode:
27+
name: hidden unicode characters
28+
runs-on: ubuntu-latest
29+
permissions:
30+
pull-requests: read # required by the composite's `gh pr diff` call
31+
steps:
32+
- uses: weaviate/weaviate/.github/actions/security-lint@3e52fc80a244f4644d4facc6a4e705ea6eda9039 # PR #11093
33+
with:
34+
pr-number: ${{ github.event.pull_request.number }}
35+
github-token: ${{ github.token }}

0 commit comments

Comments
 (0)