forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (68 loc) · 3.1 KB
/
Copy pathsecurity.yml
File metadata and controls
84 lines (68 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: workplace-security
on:
pull_request:
branches: [copilot-workplace]
workflow_dispatch:
permissions:
contents: read
jobs:
security:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Static workplace gate
run: bun run security:check
- name: Generate deterministic SBOMs
run: |
bun run security:sbom --output artifacts/security/sbom-a.cdx.json
bun run security:sbom --output artifacts/security/sbom-b.cdx.json
cmp artifacts/security/sbom-a.cdx.json artifacts/security/sbom-b.cdx.json
- name: Upload SBOM
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: workplace-sbom
path: artifacts/security/sbom-a.cdx.json
- name: Core security tests
working-directory: packages/core
run: bun test test/outbound.test.ts test/effect/observability.test.ts test/project-copy.test.ts
- name: Server security tests
working-directory: packages/opencode
run: bun test test/server/httpapi-cors.test.ts test/server/httpapi-listen.test.ts test/mcp/oauth-callback.test.ts test/effect/runtime-flags.test.ts test/tool/registry.test.ts test/lsp/index.test.ts
- name: App security tests
working-directory: packages/app
run: bun test --preload ./happydom.ts src/context/server.test.ts src/context/permission-auto-respond.test.ts
- name: Desktop security tests
working-directory: packages/desktop
run: bun test electron-builder.config.test.ts src/main/attachment-picker.test.ts src/main/store-cleanup.test.ts src/main/renderer-url.test.ts
packaged-app:
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Build production application
working-directory: packages/desktop
env:
OPENCODE_CHANNEL: prod
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_API_KEY: ${{ runner.temp }}/AuthKey.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY }}
run: |
printf '%s' "$APPLE_API_KEY_CONTENT" > "$APPLE_API_KEY"
bun run build
bun electron-builder --mac dir --config electron-builder.config.ts --publish never
- name: Attest packaged CostasCode application
run: bun run security:attest --app "packages/desktop/dist/mac*/CostasCode.app"
- name: Upload package attestation
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: costascode-package-attestation
path: artifacts/security/costascode-package-attestation.json