code-foundry 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,241 @@
1
+ name: Code Foundry CodeQL
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ runtime-repository:
7
+ description: Repository containing the Code Foundry runtime.
8
+ required: false
9
+ type: string
10
+ default: 0xPlayerOne/code-foundry
11
+ runtime-ref:
12
+ description: Code Foundry runtime tag or ref.
13
+ required: false
14
+ type: string
15
+ default: v0.11.0
16
+
17
+ permissions:
18
+ actions: read
19
+ contents: read
20
+ packages: read
21
+ security-events: write
22
+
23
+ env:
24
+ REPO_FOUNDRY_PROFILE: ${{ vars.REPO_FOUNDRY_PROFILE }}
25
+ REPO_FOUNDRY_LANGUAGES: ${{ vars.REPO_FOUNDRY_LANGUAGES }}
26
+ REPO_FOUNDRY_FEATURES: ${{ vars.REPO_FOUNDRY_FEATURES }}
27
+
28
+ concurrency:
29
+ group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
30
+ cancel-in-progress: true
31
+
32
+ jobs:
33
+ detect:
34
+ name: Detect
35
+ runs-on: ubuntu-slim
36
+ timeout-minutes: 10
37
+ outputs:
38
+ languages: ${{ steps.languages.outputs.languages }}
39
+ code_security: ${{ steps.security.outputs.status }}
40
+ actions_available: ${{ steps.languages.outputs.actions_available }}
41
+ actions_changed: ${{ steps.languages.outputs.actions_changed }}
42
+ actions_build_mode: ${{ steps.languages.outputs.actions_build_mode }}
43
+ javascript_available: ${{ steps.languages.outputs.javascript_available }}
44
+ javascript_changed: ${{ steps.languages.outputs.javascript_changed }}
45
+ javascript_build_mode: ${{ steps.languages.outputs.javascript_build_mode }}
46
+ python_available: ${{ steps.languages.outputs.python_available }}
47
+ python_changed: ${{ steps.languages.outputs.python_changed }}
48
+ python_build_mode: ${{ steps.languages.outputs.python_build_mode }}
49
+ rust_available: ${{ steps.languages.outputs.rust_available }}
50
+ rust_changed: ${{ steps.languages.outputs.rust_changed }}
51
+ rust_build_mode: ${{ steps.languages.outputs.rust_build_mode }}
52
+ steps:
53
+ - name: Detect Code Security
54
+ id: security
55
+ env:
56
+ GH_TOKEN: ${{ github.token }}
57
+ run: |
58
+ status="disabled"
59
+ if [ "${{ github.event.repository.private }}" != "true" ]; then
60
+ status="enabled"
61
+ else
62
+ status="$(gh api "repos/${GITHUB_REPOSITORY}" --jq '.security_and_analysis.code_security.status // "disabled"' 2>/dev/null || printf 'disabled')"
63
+ fi
64
+ printf 'status=%s\n' "$status" >> "$GITHUB_OUTPUT"
65
+ - name: Checkout
66
+ if: ${{ !github.event.repository.private || steps.security.outputs.status == 'enabled' }}
67
+ uses: actions/checkout@v7
68
+ with:
69
+ fetch-depth: 2
70
+ filter: blob:none
71
+ sparse-checkout: |
72
+ .github
73
+ .mise.toml
74
+ mise.lock
75
+ package.json
76
+ bun.lock
77
+ bun.lockb
78
+ pnpm-lock.yaml
79
+ yarn.lock
80
+ package-lock.json
81
+ sparse-checkout-cone-mode: false
82
+ - name: Runtime
83
+ if: ${{ !github.event.repository.private || steps.security.outputs.status == 'enabled' }}
84
+ uses: actions/checkout@v7
85
+ with:
86
+ repository: ${{ inputs.runtime-repository }}
87
+ ref: ${{ inputs.runtime-ref }}
88
+ path: .code-foundry
89
+ sparse-checkout: |
90
+ .github/actions
91
+ .github/scripts
92
+ - name: Install runtime
93
+ if: ${{ !github.event.repository.private || steps.security.outputs.status == 'enabled' }}
94
+ run: |
95
+ mkdir -p .github/actions .github/scripts
96
+ cp -R .code-foundry/.github/actions/. .github/actions/
97
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
98
+ - id: languages
99
+ name: Detect languages
100
+ env:
101
+ CODEQL_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
102
+ REPO_FOUNDRY_CODE_SECURITY: ${{ steps.security.outputs.status }}
103
+ REPO_FOUNDRY_PRIVATE: ${{ github.event.repository.private }}
104
+ run: |
105
+ if [ "$REPO_FOUNDRY_PRIVATE" = "true" ] && [ "$REPO_FOUNDRY_CODE_SECURITY" != "enabled" ]; then
106
+ echo 'languages=[]' >> "$GITHUB_OUTPUT"
107
+ else
108
+ bash .github/scripts/codeql-languages.sh
109
+ fi
110
+
111
+ analyze-actions:
112
+ name: Analyze (Actions)
113
+ needs: detect
114
+ if: >-
115
+ ( !github.event.repository.private || needs.detect.outputs.code_security == 'enabled' ) &&
116
+ needs.detect.outputs.actions_available == 'true' &&
117
+ needs.detect.outputs.actions_changed == 'true'
118
+ runs-on: ubuntu-latest
119
+ timeout-minutes: 30
120
+ steps:
121
+ - name: Checkout
122
+ uses: actions/checkout@v7
123
+ - name: Runtime
124
+ uses: actions/checkout@v7
125
+ with:
126
+ repository: ${{ inputs.runtime-repository }}
127
+ ref: ${{ inputs.runtime-ref }}
128
+ path: .code-foundry
129
+ sparse-checkout: |
130
+ .github/actions
131
+ .github/scripts
132
+ - name: Install runtime
133
+ run: |
134
+ mkdir -p .github/actions .github/scripts
135
+ cp -R .code-foundry/.github/actions/. .github/actions/
136
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
137
+ - name: Analyze
138
+ uses: ./.github/actions/codeql
139
+ with:
140
+ language: actions
141
+ build-mode: ${{ needs.detect.outputs.actions_build_mode }}
142
+ category: /language:actions
143
+
144
+ analyze-typescript:
145
+ name: Analyze (TypeScript)
146
+ needs: detect
147
+ if: >-
148
+ ( !github.event.repository.private || needs.detect.outputs.code_security == 'enabled' ) &&
149
+ needs.detect.outputs.javascript_available == 'true' &&
150
+ needs.detect.outputs.javascript_changed == 'true'
151
+ runs-on: ubuntu-latest
152
+ timeout-minutes: 30
153
+ steps:
154
+ - name: Checkout
155
+ uses: actions/checkout@v7
156
+ - name: Runtime
157
+ uses: actions/checkout@v7
158
+ with:
159
+ repository: ${{ inputs.runtime-repository }}
160
+ ref: ${{ inputs.runtime-ref }}
161
+ path: .code-foundry
162
+ sparse-checkout: |
163
+ .github/actions
164
+ .github/scripts
165
+ - name: Install runtime
166
+ run: |
167
+ mkdir -p .github/actions .github/scripts
168
+ cp -R .code-foundry/.github/actions/. .github/actions/
169
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
170
+ - name: Analyze
171
+ uses: ./.github/actions/codeql
172
+ with:
173
+ language: javascript-typescript
174
+ build-mode: ${{ needs.detect.outputs.javascript_build_mode }}
175
+ category: /language:javascript-typescript
176
+
177
+ analyze-python:
178
+ name: Analyze (Python)
179
+ needs: detect
180
+ if: >-
181
+ ( !github.event.repository.private || needs.detect.outputs.code_security == 'enabled' ) &&
182
+ needs.detect.outputs.python_available == 'true' &&
183
+ needs.detect.outputs.python_changed == 'true'
184
+ runs-on: ubuntu-latest
185
+ timeout-minutes: 30
186
+ steps:
187
+ - name: Checkout
188
+ uses: actions/checkout@v7
189
+ - name: Runtime
190
+ uses: actions/checkout@v7
191
+ with:
192
+ repository: ${{ inputs.runtime-repository }}
193
+ ref: ${{ inputs.runtime-ref }}
194
+ path: .code-foundry
195
+ sparse-checkout: |
196
+ .github/actions
197
+ .github/scripts
198
+ - name: Install runtime
199
+ run: |
200
+ mkdir -p .github/actions .github/scripts
201
+ cp -R .code-foundry/.github/actions/. .github/actions/
202
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
203
+ - name: Analyze
204
+ uses: ./.github/actions/codeql
205
+ with:
206
+ language: python
207
+ build-mode: ${{ needs.detect.outputs.python_build_mode }}
208
+ category: /language:python
209
+
210
+ analyze-rust:
211
+ name: Analyze (Rust)
212
+ needs: detect
213
+ if: >-
214
+ ( !github.event.repository.private || needs.detect.outputs.code_security == 'enabled' ) &&
215
+ needs.detect.outputs.rust_available == 'true' &&
216
+ needs.detect.outputs.rust_changed == 'true'
217
+ runs-on: ubuntu-latest
218
+ timeout-minutes: 30
219
+ steps:
220
+ - name: Checkout
221
+ uses: actions/checkout@v7
222
+ - name: Runtime
223
+ uses: actions/checkout@v7
224
+ with:
225
+ repository: ${{ inputs.runtime-repository }}
226
+ ref: ${{ inputs.runtime-ref }}
227
+ path: .code-foundry
228
+ sparse-checkout: |
229
+ .github/actions
230
+ .github/scripts
231
+ - name: Install runtime
232
+ run: |
233
+ mkdir -p .github/actions .github/scripts
234
+ cp -R .code-foundry/.github/actions/. .github/actions/
235
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
236
+ - name: Analyze
237
+ uses: ./.github/actions/codeql
238
+ with:
239
+ language: rust
240
+ build-mode: ${{ needs.detect.outputs.rust_build_mode }}
241
+ category: /language:rust
@@ -10,224 +10,8 @@ on:
10
10
  permissions:
11
11
  contents: read
12
12
 
13
- env:
14
- REPO_FOUNDRY_PROFILE: ${{ vars.REPO_FOUNDRY_PROFILE }}
15
- REPO_FOUNDRY_LANGUAGES: ${{ vars.REPO_FOUNDRY_LANGUAGES }}
16
- REPO_FOUNDRY_FEATURES: ${{ vars.REPO_FOUNDRY_FEATURES }}
17
- REPO_FOUNDRY_PACKAGE_MANAGER: ${{ vars.REPO_FOUNDRY_PACKAGE_MANAGER }}
18
- REPO_FOUNDRY_CACHE_PACKAGES: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
19
- REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}
20
-
21
- concurrency:
22
- group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
23
- cancel-in-progress: true
24
-
25
13
  jobs:
26
- profile:
27
- name: Profile
28
- runs-on: ubuntu-slim
29
- timeout-minutes: 10
30
- outputs:
31
- javascript: ${{ steps.profile.outputs.javascript }}
32
- rust: ${{ steps.profile.outputs.rust }}
33
- python: ${{ steps.profile.outputs.python }}
34
- python_requirements: ${{ steps.profile.outputs.python_requirements }}
35
- steps:
36
- - name: Checkout
37
- uses: actions/checkout@v7
38
- with:
39
- fetch-depth: 2
40
- filter: blob:none
41
- sparse-checkout: |
42
- .github
43
- .mise.toml
44
- mise.lock
45
- .npmrc
46
- .pnpmfile.cjs
47
- .yarnrc*
48
- **/package.json
49
- **/bun.lock
50
- **/bun.lockb
51
- **/pnpm-lock.yaml
52
- **/yarn.lock
53
- **/package-lock.json
54
- **/Cargo.toml
55
- **/Cargo.lock
56
- **/.cargo/**
57
- **/pyproject.toml
58
- **/requirements*.txt
59
- **/setup.py
60
- **/setup.cfg
61
- **/Pipfile
62
- **/Pipfile.lock
63
- **/poetry.lock
64
- **/uv.lock
65
- sparse-checkout-cone-mode: false
66
- - name: Detect
67
- id: profile
68
- run: bash .github/scripts/security.sh profile >> "$GITHUB_OUTPUT"
69
-
70
- dependency-audit-javascript:
71
- name: Dependency Audit (JavaScript)
72
- runs-on: ubuntu-slim
73
- timeout-minutes: 20
74
- steps:
75
- - name: Checkout
76
- uses: actions/checkout@v7
77
- with:
78
- # JavaScript audits only need manifests, lockfiles, and audit config.
79
- filter: blob:none
80
- sparse-checkout: |
81
- .github
82
- .mise.toml
83
- mise.lock
84
- .npmrc
85
- .pnpmfile.cjs
86
- .yarnrc*
87
- **/package.json
88
- **/bun.lock
89
- **/bun.lockb
90
- **/pnpm-lock.yaml
91
- **/yarn.lock
92
- **/package-lock.json
93
- sparse-checkout-cone-mode: false
94
- - name: Detect
95
- id: applicability
96
- run: bash .github/scripts/security.sh should_run javascript >> "$GITHUB_OUTPUT"
97
- - name: Setup
98
- if: steps.applicability.outputs.applicable == 'true'
99
- uses: ./.github/actions/setup
100
- with:
101
- mise-scope: javascript
102
- cache-save: ${{ github.event_name != 'pull_request' }}
103
- - name: Audit dependencies
104
- if: steps.applicability.outputs.applicable == 'true'
105
- run: bash .github/scripts/security.sh audit javascript
106
-
107
- dependency-audit-rust:
108
- name: Dependency Audit (Rust)
109
- # ubuntu-latest ships with Cargo/Rust; use it for the audit-only job and
110
- # fall back to the repository toolchain when the image lacks Rust.
111
- runs-on: ${{ vars.REPO_FOUNDRY_RUST_AUDIT_RUNNER || 'ubuntu-latest' }}
112
- timeout-minutes: 20
113
- steps:
114
- - name: Checkout
115
- uses: actions/checkout@v7
116
- with:
117
- # Rust audits only need manifests, Cargo configuration, and audit config.
118
- filter: blob:none
119
- sparse-checkout: |
120
- .github
121
- .mise.toml
122
- mise.lock
123
- **/Cargo.toml
124
- **/Cargo.lock
125
- **/.cargo/**
126
- sparse-checkout-cone-mode: false
127
- - name: Detect
128
- id: applicability
129
- run: bash .github/scripts/security.sh should_run rust >> "$GITHUB_OUTPUT"
130
- - name: Check Rust
131
- id: system-rust
132
- if: steps.applicability.outputs.applicable == 'true'
133
- shell: bash
134
- run: |
135
- if command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1; then
136
- cargo --version
137
- rustc --version
138
- echo 'available=true' >> "$GITHUB_OUTPUT"
139
- else
140
- echo 'available=false' >> "$GITHUB_OUTPUT"
141
- fi
142
- - name: Setup
143
- if: >-
144
- steps.applicability.outputs.applicable == 'true' &&
145
- steps.system-rust.outputs.available != 'true'
146
- uses: ./.github/actions/setup
147
- with:
148
- mise-scope: rust
149
- cache-save: ${{ github.event_name != 'pull_request' }}
150
- - name: Install cargo-audit
151
- if: steps.applicability.outputs.applicable == 'true'
152
- uses: taiki-e/install-action@v2
153
- with:
154
- tool: cargo-audit
155
- - name: Audit dependencies
156
- if: steps.applicability.outputs.applicable == 'true'
157
- run: bash .github/scripts/security.sh audit rust
158
-
159
- dependency-audit-python:
160
- name: Dependency Audit (Python) / ${{ matrix.requirement }}
161
- needs: profile
162
- if: >-
163
- ${{ needs.profile.result == 'success' &&
164
- needs.profile.outputs.python == 'true' &&
165
- needs.profile.outputs.python_requirements != '["none"]' }}
166
- strategy:
167
- fail-fast: false
168
- max-parallel: 8
169
- matrix:
170
- requirement: ${{ fromJSON(needs.profile.outputs.python_requirements) }}
171
- runs-on: ubuntu-slim
172
- timeout-minutes: 20
173
- env:
174
- REPO_FOUNDRY_PYTHON_REQUIREMENT: ${{ matrix.requirement }}
175
- steps:
176
- - name: Checkout
177
- uses: actions/checkout@v7
178
- with:
179
- # Python audits only need manifests, lockfiles, and audit config.
180
- filter: blob:none
181
- sparse-checkout: |
182
- .github
183
- .mise.toml
184
- mise.lock
185
- **/pyproject.toml
186
- **/requirements*.txt
187
- **/setup.py
188
- **/setup.cfg
189
- **/Pipfile
190
- **/Pipfile.lock
191
- **/poetry.lock
192
- **/uv.lock
193
- sparse-checkout-cone-mode: false
194
- - name: Setup
195
- uses: ./.github/actions/setup
196
- with:
197
- mise-scope: python
198
- cache-save: ${{ github.event_name != 'pull_request' }}
199
- - name: Audit dependencies
200
- run: bash .github/scripts/security.sh audit python
201
-
202
- dependency-audit-python-gate:
203
- name: Dependency Audit (Python)
204
- needs: [profile, dependency-audit-python]
205
- if: always()
206
- runs-on: ubuntu-slim
207
- timeout-minutes: 5
208
- steps:
209
- - name: Gate
210
- env:
211
- PROFILE_RESULT: ${{ needs.profile.result }}
212
- AUDIT_RESULT: ${{ needs.dependency-audit-python.result }}
213
- run: |
214
- if [ "$PROFILE_RESULT" != success ]; then
215
- echo "Python audit profile failed: $PROFILE_RESULT" >&2
216
- exit 1
217
- fi
218
- case "$AUDIT_RESULT" in
219
- success|skipped) exit 0 ;;
220
- *) echo "Python dependency audit failed: $AUDIT_RESULT" >&2; exit 1 ;;
221
- esac
222
-
223
- dependency-review:
224
- name: Dependency Review
225
- if: ${{ github.event_name == 'pull_request' && !github.event.repository.private }}
226
- runs-on: ubuntu-slim
227
- timeout-minutes: 10
228
- steps:
229
- - name: Review
230
- uses: actions/dependency-review-action@v5
231
- with:
232
- fail-on-severity: high
233
- license-check: true
14
+ security:
15
+ name: Security
16
+ uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-security.yml@v0.10.0
17
+ secrets: inherit
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.12.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.11.0...v0.12.0) (2026-07-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **codeql:** add reusable CodeQL workflow runtime ([65896bb](https://github.com/0xPlayerOne/code-foundry/commit/65896bb407ad9d792c962e86d63384849f711a16))
9
+
10
+ ## [0.11.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.10.0...v0.11.0) (2026-07-28)
11
+
12
+
13
+ ### Features
14
+
15
+ * **security:** document centralized security runtime ([f8427fe](https://github.com/0xPlayerOne/code-foundry/commit/f8427fe740b2753c83a400766d7dd7ac453f3c5b))
16
+
3
17
  ## [0.10.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.9.0...v0.10.0) (2026-07-28)
4
18
 
5
19
 
package/README.md CHANGED
@@ -42,6 +42,10 @@ the selected repository is saved in `.github/template.yml` and rendered into
42
42
  the small `ci.yml` and `test.yml` wrappers automatically. The equivalent
43
43
  environment variable is `REPO_FOUNDRY_RUNTIME_REPOSITORY`.
44
44
 
45
+ The standard Security wrapper uses the same runtime contract, so dependency
46
+ audits and the public-only Dependency Review policy can be upgraded centrally
47
+ without copying security scripts into every consumer repository.
48
+
45
49
  Initialization defaults to AGPL for new repositories. Synchronization defaults
46
50
  to `--license preserve`, so an existing repository's license is never replaced
47
51
  unless you explicitly select a license or provide `--license-file`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",