code-foundry 0.31.8 → 0.31.10

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.
@@ -39,7 +39,7 @@ jobs:
39
39
  if: needs.detect.outputs.enabled == 'true' && needs.detect.outputs.token == 'true'
40
40
  uses: 0xPlayerOne/opencode-security/.github/workflows/opencode-security.yml@main
41
41
  with:
42
- source_ref: main
42
+ source_ref: ${{ github.event.pull_request.head.ref || 'main' }}
43
43
  runner: ubuntu-latest
44
44
  mode: standard
45
45
  fail_on_severity: high
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.31.10](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.9...v0.31.10) (2026-07-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **opencode:** avoid duplicate self checks ([71b1201](https://github.com/0xPlayerOne/code-foundry/commit/71b1201baf58624401676b99fa257780b1eb1abc))
9
+
10
+ ## [0.31.9](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.8...v0.31.9) (2026-07-30)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **doctor:** deduplicate required check contexts ([f244494](https://github.com/0xPlayerOne/code-foundry/commit/f24449448f177c99978fe216b92385909f275d89))
16
+
3
17
  ## [0.31.8](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.7...v0.31.8) (2026-07-30)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.31.8",
3
+ "version": "0.31.10",
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",
@@ -18,10 +18,7 @@ export function doctorGithub(root) {
18
18
  const protection = ghJson(['api', `repos/${repository}/branches/main/protection`])
19
19
  if (!protection) warnings.push('main branch protection is not readable or is not configured.')
20
20
  else {
21
- const required = [
22
- ...(protection.required_status_checks?.contexts ?? []),
23
- ...(protection.required_status_checks?.checks ?? []).map(/** @param {any} check */ (check) => check.context),
24
- ].filter(Boolean)
21
+ const required = requiredContexts(protection)
25
22
  details.requiredChecks = required
26
23
  const duplicateNames = required.filter((name) => /\b([^/]+) \/ \1\b/i.test(name))
27
24
  if (duplicateNames.length) errors.push(`required checks contain duplicate workflow prefixes: ${duplicateNames.join(', ')}`)
@@ -34,10 +31,7 @@ export function doctorGithub(root) {
34
31
  details.observedChecks = observed
35
32
  if (!observed.length) warnings.push('no check runs were observed on the current main commit; exact check validation is deferred until CI runs.')
36
33
  if (protection?.required_status_checks) {
37
- const required = [
38
- ...(protection.required_status_checks.contexts ?? []),
39
- ...(protection.required_status_checks.checks ?? []).map(/** @param {any} check */ (check) => check.context),
40
- ].filter(Boolean)
34
+ const required = requiredContexts(protection)
41
35
  const missing = required.filter((name) => observed.length && !observed.includes(name))
42
36
  if (missing.length) warnings.push(`required checks not observed on current main: ${missing.join(', ')}`)
43
37
  }
@@ -75,6 +69,14 @@ export function doctorGithub(root) {
75
69
  return { errors, warnings, details }
76
70
  }
77
71
 
72
+ /** @param {any} protection @returns {string[]} */
73
+ function requiredContexts(protection) {
74
+ return [...new Set([
75
+ ...(protection.required_status_checks?.contexts ?? []),
76
+ ...(protection.required_status_checks?.checks ?? []).map(/** @param {any} check */ (check) => check.context),
77
+ ].filter(Boolean))]
78
+ }
79
+
78
80
  /** @param {string} root @returns {{ errors: string[], warnings: string[] }} */
79
81
  function inspectWorkflows(root) {
80
82
  /** @type {string[]} */
@@ -1,48 +0,0 @@
1
- name: Code Foundry
2
-
3
- on:
4
- pull_request:
5
- branches: [staging]
6
- workflow_dispatch:
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- detect:
13
- name: OpenCode Security / Detect
14
- if: >-
15
- github.event_name == 'workflow_dispatch' ||
16
- startsWith(github.event.pull_request.head.ref, 'release-please--branches--main')
17
- runs-on: ubuntu-slim
18
- outputs:
19
- enabled: ${{ steps.detect.outputs.enabled }}
20
- token: ${{ steps.detect.outputs.token }}
21
- steps:
22
- - name: Checkout
23
- uses: actions/checkout@v7
24
- - name: Detect configuration and token
25
- id: detect
26
- env:
27
- OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
28
- run: |
29
- enabled=false
30
- token=false
31
- if grep -Eq '^opencode_security:\s*(true|auto)\s*$' .github/code-foundry.yml 2>/dev/null; then enabled=true; fi
32
- if [ -n "$OPENCODE_API_KEY" ]; then token=true; fi
33
- echo "enabled=$enabled" >> "$GITHUB_OUTPUT"
34
- echo "token=$token" >> "$GITHUB_OUTPUT"
35
-
36
- scan:
37
- name: OpenCode Security / Scan
38
- needs: detect
39
- if: needs.detect.outputs.enabled == 'true' && needs.detect.outputs.token == 'true'
40
- uses: 0xPlayerOne/opencode-security/.github/workflows/opencode-security.yml@main
41
- with:
42
- source_ref: main
43
- runner: ubuntu-latest
44
- mode: standard
45
- fail_on_severity: high
46
- max_cost_usd: 1
47
- secrets:
48
- OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}