Skip to content

Commit d65e2a6

Browse files
Jonathan D.A. Jewellclaude
andcommitted
chore: add RSR enforcement workflows
Added standard enforcement workflows: - CodeQL security scanning - OSSF Scorecard - Code quality checks - Mirror to forges - Guix/Nix policy - Security policy - Well-known standards - Workflow linter - Secret scanner - RSR anti-pattern check - npm/bun blocker - TypeScript blocker 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 25380e2 commit d65e2a6

12 files changed

Lines changed: 127 additions & 45 deletions

.github/workflows/codeql.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
1-
# SPDX-License-Identifier: MPL-2.0
2-
# CodeQL disabled - no scannable source code detected
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
32
name: CodeQL Security Analysis
43

54
on:
6-
workflow_dispatch: # Manual trigger only
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
schedule:
10+
- cron: '0 6 * * 1'
711

812
permissions: read-all
913

1014
jobs:
11-
placeholder:
15+
analyze:
1216
runs-on: ubuntu-latest
13-
if: false
17+
permissions:
18+
contents: read
19+
security-events: write
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- language: actions
25+
build-mode: none
26+
1427
steps:
15-
- run: echo "Enable when source code is added"
28+
- name: Checkout
29+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
33+
with:
34+
languages: ${{ matrix.language }}
35+
build-mode: ${{ matrix.build-mode }}
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
39+
with:
40+
category: "/language:${{ matrix.language }}"

.github/workflows/guix-nix-policy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
name: Guix/Nix Package Policy
3-
permissions: read-all
43
on: [push, pull_request]
4+
5+
permissions: read-all
6+
57
jobs:
68
check:
79
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
812
steps:
9-
- uses: actions/checkout@v6
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1014
- name: Enforce Guix primary / Nix fallback
1115
run: |
1216
# Check for package manager files

.github/workflows/mirror.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
33
name: Mirror to Git Forges
44

@@ -126,10 +126,16 @@ jobs:
126126
with:
127127
fetch-depth: 0
128128

129+
- name: Setup Rust
130+
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
131+
with:
132+
toolchain: stable
133+
129134
- name: Install Radicle
130135
run: |
131-
curl -sSf https://radicle.xyz/install | sh
132-
echo "$HOME/.radicle/bin" >> $GITHUB_PATH
136+
# Install via cargo (safer than curl|sh)
137+
cargo install radicle-cli --locked
138+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
133139
134140
- name: Mirror to Radicle
135141
run: |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
2+
name: NPM/Bun Blocker
3+
on: [push, pull_request]
4+
5+
permissions: read-all
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- name: Block npm/bun
15+
run: |
16+
if [ -f "package-lock.json" ] || [ -f "bun.lockb" ] || [ -f ".npmrc" ]; then
17+
echo "❌ npm/bun artifacts detected. Use Deno instead."
18+
exit 1
19+
fi
20+
echo "✅ No npm/bun violations"

.github/workflows/quality.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
name: Code Quality
3-
permissions: read-all
43
on: [push, pull_request]
54

5+
6+
permissions: read-all
7+
68
jobs:
79
lint:
810
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
913
steps:
10-
- uses: actions/checkout@v6
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1115

1216
- name: Check file permissions
1317
run: |
1418
find . -type f -perm /111 -name "*.sh" | head -10 || true
1519
1620
- name: Check for secrets
17-
uses: trufflesecurity/trufflehog@main
21+
uses: trufflesecurity/trufflehog@05cccb53bc9e13bc6d17997db5a6bcc3df44bf2f # v3.92.3
1822
with:
1923
path: ./
2024
base: ${{ github.event.pull_request.base.sha || github.event.before }}
@@ -31,13 +35,15 @@ jobs:
3135
find . -type f -size +1M -not -path "./.git/*" | head -10 || echo "No large files"
3236
3337
- name: EditorConfig check
34-
uses: editorconfig-checker/action-editorconfig-checker@main
38+
uses: editorconfig-checker/action-editorconfig-checker@8c9b118d446fce7e6410b6c0a3ce2f83bd04e97a # v2.1.0
3539
continue-on-error: true
3640

3741
docs:
3842
runs-on: ubuntu-latest
43+
permissions:
44+
contents: read
3945
steps:
40-
- uses: actions/checkout@v6
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4147
- name: Check documentation
4248
run: |
4349
MISSING=""

.github/workflows/rsr-antipattern.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
# RSR Anti-Pattern CI Check
2-
# SPDX-License-Identifier: MPL-2.0
3+
# SPDX-License-Identifier: AGPL-3.0-or-later
34
#
45
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
56
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
67

78
name: RSR Anti-Pattern Check
8-
permissions: read-all
99

1010
on:
1111
push:
1212
branches: [main, master, develop]
1313
pull_request:
1414
branches: [main, master, develop]
1515

16+
17+
permissions: read-all
18+
1619
jobs:
1720
antipattern-check:
1821
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
1924
steps:
20-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2126

2227
- name: Check for TypeScript
2328
run: |
24-
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
29+
# Exclude bindings/deno/ - those are Deno FFI files using Deno.dlopen, not plain TypeScript
30+
# Exclude .d.ts files - those are TypeScript type declarations for ReScript FFI
31+
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) | grep -v node_modules | grep -v 'bindings/deno' | grep -v '\.d\.ts$' || true)
32+
if [ -n "$TS_FILES" ]; then
2533
echo "❌ TypeScript files detected - use ReScript instead"
26-
find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules
34+
echo "$TS_FILES"
2735
exit 1
2836
fi
29-
echo "✅ No TypeScript files"
37+
echo "✅ No TypeScript files (Deno FFI bindings excluded)"
3038
3139
- name: Check for Go
3240
run: |

.github/workflows/scorecard.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
name: OSSF Scorecard
33
on:
44
push:
55
branches: [main, master]
66
schedule:
7-
- cron: '0 4 * * 0'
7+
- cron: '0 4 * * *'
8+
workflow_dispatch:
89

910
permissions: read-all
1011

@@ -15,17 +16,17 @@ jobs:
1516
security-events: write
1617
id-token: write
1718
steps:
18-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1920
with:
2021
persist-credentials: false
21-
22+
2223
- name: Run Scorecard
23-
uses: ossf/scorecard-action@v2.4.3
24+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.3.1
2425
with:
2526
results_file: results.sarif
2627
results_format: sarif
27-
28+
2829
- name: Upload results
29-
uses: github/codeql-action/upload-sarif@v4
30+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.31.8
3031
with:
3132
sarif_file: results.sarif

.github/workflows/secret-scanner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
# Prevention workflow - scans for hardcoded secrets before they reach main
33
name: Secret Scanner
44

.github/workflows/security-policy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
name: Security Policy
3-
permissions: read-all
43
on: [push, pull_request]
4+
5+
permissions: read-all
6+
57
jobs:
68
check:
79
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
812
steps:
9-
- uses: actions/checkout@v6
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1014
- name: Security checks
1115
run: |
1216
FAILED=false

.github/workflows/ts-blocker.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
22
name: TypeScript/JavaScript Blocker
3-
permissions: read-all
43
on: [push, pull_request]
4+
5+
permissions: read-all
6+
57
jobs:
68
check:
79
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
812
steps:
9-
- uses: actions/checkout@v6
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1014
- name: Block new TypeScript/JavaScript
1115
run: |
1216
NEW_TS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(ts|tsx)$' | grep -v '\.gen\.' || true)

0 commit comments

Comments
 (0)