Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c645744
ci: ignore
thdxr Jun 27, 2025
3fce08a
ci: ignore
thdxr Jun 27, 2025
c78073e
fix: unawaited promise causes opencode to use unenabled formatter (#625)
rekram1-node Jul 2, 2025
fadbf39
fix: typescript error (#618)
timoclsn Jul 3, 2025
1ba378f
ignore: ci
thdxr Jul 19, 2025
046fe8b
ci: ignore
thdxr Jul 19, 2025
67c656e
Add opencode workflow
Aug 24, 2025
529033c
Add opencode workflow
Aug 24, 2025
06881ee
Add opencode workflow
Aug 24, 2025
6b88945
Add opencode workflow
Aug 25, 2025
8c12df0
Add opencode workflow
Aug 25, 2025
061cf28
add threat scanning workflows
riatzukiza Oct 24, 2025
33a2c99
adjusted event triggers
riatzukiza Oct 24, 2025
ff00c9a
reverting accidental edit
riatzukiza Oct 24, 2025
bee3be5
ci: guard AV workflows on PRs + robust tag resolution
riatzukiza Oct 24, 2025
afd84b2
ci: enable PR/push AV scans (no releases required)
riatzukiza Oct 24, 2025
a29780c
ci: add heuristic build steps to PR ClamAV job (Node/Rust/Go)
riatzukiza Oct 24, 2025
7286ea4
ci: harden heuristic PR build (corepack, non-fatal builds, tarball)
riatzukiza Oct 24, 2025
17d3580
ci: add Bun (bun.lockb) support to PR build (Ubuntu)
riatzukiza Oct 24, 2025
40d1413
ci: remove third‑party setup actions in PR scan; install Bun/Rust via…
riatzukiza Oct 24, 2025
b3c0c4a
ci: add minimal smoke workflow (ubuntu/windows/macos) to diagnose sta…
riatzukiza Oct 24, 2025
83c040e
removeed push action
riatzukiza Oct 24, 2025
54f4842
yaml error
riatzukiza Oct 24, 2025
58f9461
removed useless smoke test
riatzukiza Oct 24, 2025
6f25773
ci: fix scanners (owasp dep-check action pin, clamav DB init, windows…
riatzukiza Oct 24, 2025
beaeb28
ci(owasp,defender): fix dep-check inputs (no 'out'; use format=ALL + …
riatzukiza Oct 24, 2025
2129c97
ci(clamav): detect bun/node/rust/go across repo; only run node when n…
riatzukiza Oct 24, 2025
45e435e
ci(defender): avoid Compress-Archive lock by zipping to %RUNNER_TEMP%…
riatzukiza Oct 24, 2025
4c8b58a
ci(defender-pr): scan directory instead of the zip to avoid archive-s…
riatzukiza Oct 24, 2025
40b43fc
ci(owasp): prep dependencies (bun or node) so ODC sees installed modu…
riatzukiza Oct 24, 2025
6611e1f
ci(defender-pr): fix scan_root propagation (use step outputs) and add…
riatzukiza Oct 24, 2025
daa7bf9
ci(clamav-pr): build with Bun per README/workflows (no language detec…
riatzukiza Oct 24, 2025
80b6636
ci(clamav release): build with Bun (single build per README), package…
riatzukiza Oct 24, 2025
a820c3c
ci(clamav): use local setup-bun action per repo docs; split PATH appl…
riatzukiza Oct 24, 2025
891b0c9
build: add composite action to build with Bun and package single zip …
riatzukiza Oct 24, 2025
0444eec
ci(clamav-pr): use shared build-package composite; produce single bun…
riatzukiza Oct 24, 2025
a168112
ci(clamav-release): consume shared build-package; scan extracted bund…
riatzukiza Oct 24, 2025
b577a3f
ci(defender): depend on shared build-package; download single opencod…
riatzukiza Oct 24, 2025
a8f1191
ci(clamav): unify into single workflow .github/workflows/clam-av.yml;…
riatzukiza Oct 24, 2025
61e7e15
build(composite): use bunx turbo run build (root build script not pre…
riatzukiza Oct 24, 2025
53b6705
ci(owasp): bun monorepo support — setup via local action, bun install…
riatzukiza Oct 24, 2025
78be924
ci(setup-bun): pin default Bun to 1.3.0 to satisfy strict build scrip…
riatzukiza Oct 24, 2025
83b53bf
ci(bun): restore setup-bun default to 'latest' to avoid breaking exis…
riatzukiza Oct 24, 2025
6b3feca
Delete .github/workflows/clam-av-scan.yml
riatzukiza Oct 24, 2025
82ec047
Delete .github/workflows/clam-av-pr.yml
riatzukiza Oct 24, 2025
3fc9c72
chore(format): use `bunx prettier` instead of `bun run prettier` (no …
riatzukiza Oct 24, 2025
d23f761
ci(setup-bun): restore legacy behavior — run `bun install` inside set…
riatzukiza Oct 25, 2025
7e5b734
ci: pin Bun to 1.3.0 globally in setup-bun (with install step) and re…
riatzukiza Oct 25, 2025
8f3baca
ci(defender): force Bun 1.3.0 in build-package; ensure build job emit…
riatzukiza Oct 25, 2025
a7d0492
nope
riatzukiza Oct 25, 2025
517629b
so we may have needed that one
riatzukiza Oct 25, 2025
251941e
I can read
riatzukiza Oct 25, 2025
1d0d944
oops
riatzukiza Oct 25, 2025
f0c8820
????
riatzukiza Oct 25, 2025
71d1cd3
specify bun version file for setup-bun action
riatzukiza Oct 25, 2025
c7d0705
I can definitely read
riatzukiza Oct 25, 2025
7b66736
lock in bun version
riatzukiza Oct 25, 2025
bc43115
be specific
riatzukiza Oct 25, 2025
95a0145
add bun version to hash function
riatzukiza Oct 25, 2025
eba6b1e
stuff
riatzukiza Oct 25, 2025
3f0a04d
ci(setup-bun): make cache version-strict & self-invalidating; clear ~…
riatzukiza Oct 25, 2025
e550863
ci(setup-bun): read version from .bun-version and disable tool-cache;…
riatzukiza Oct 25, 2025
ba7f585
Kill robot fantasy
riatzukiza Oct 25, 2025
2dfadcf
well then
riatzukiza Oct 25, 2025
7768808
EICAR string test
riatzukiza Oct 25, 2025
b5e5317
ooops
riatzukiza Oct 25, 2025
cea79b0
trying to trigger security check
riatzukiza Oct 25, 2025
0ed71c5
it should only pass if it fails
riatzukiza Oct 25, 2025
2e85d65
robot's don't want you to be safe
riatzukiza Oct 25, 2025
8ba1a52
Won't work in github ci
riatzukiza Oct 25, 2025
d9ab35d
Add security scanning workflows
riatzukiza Oct 26, 2025
b9589eb
Adjust security scan workflows
riatzukiza Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.0
33 changes: 33 additions & 0 deletions .github/actions/build-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and package (Bun -> single zip)
description: Build with Bun (Turbo) and package a single distributable archive
outputs:
archive_path:
description: Absolute path to the archive
value: ${{ steps.pkg.outputs.archive_path }}
runs:
using: composite
steps:
- name: Setup Bun (from .bun-version)
uses: ./.github/actions/setup-bun

- name: Build (Turbo)
shell: bash
run: bunx turbo run build

- name: Ensure zip is available
shell: bash
run: sudo apt-get update -y && sudo apt-get install -y zip

- name: Package single file
id: pkg
shell: bash
run: |
set -e
mkdir -p bundle
if [ -d dist ]; then SRC=dist; elif [ -d build ]; then SRC=build; else SRC=.; fi
if [ "$SRC" = "." ]; then
zip -r bundle/opencode.zip . -x '.git/*' '.github/*' 'node_modules/*'
else
(cd "$SRC" && zip -r ../bundle/opencode.zip .)
fi
echo "archive_path=$(pwd)/bundle/opencode.zip" >> "$GITHUB_OUTPUT"
51 changes: 37 additions & 14 deletions .github/actions/setup-bun/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
name: "Setup Bun"
description: "Setup Bun with caching and install dependencies"
name: setup-bun
description: Setup Bun from .bun-version (or input) and install workspace deps
inputs:
bun-version:
description: Fallback Bun version if .bun-version is absent
required: false
default: '1.3.0'
outputs:
resolved-version:
description: The Bun version that was installed
value: ${{ steps.ver.outputs.version }}
runs:
using: "composite"
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Resolve Bun version (prefer .bun-version)
id: ver
shell: bash
run: |
if [ -f .bun-version ]; then
ver=$(tr -d '[:space:]' < .bun-version)
else
ver='${{ inputs.bun-version }}'
fi
echo "version=$ver" >> "$GITHUB_OUTPUT"
echo "Resolved Bun version: $ver"

- name: Cache ~/.bun
id: cache-bun
uses: actions/cache@v4
- name: Setup Bun (no tool-cache, exact version)
uses: oven-sh/setup-bun@v2
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb', 'bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
bun-version: ${{ steps.ver.outputs.version }}
no-cache: true

- name: Verify Bun version
shell: bash
run: |
set -e
echo "bun version: $(bun --version)"
test "$(bun --version | awk '{print $1}')" = "${{ steps.ver.outputs.version }}"

- name: Install dependencies
run: bun install
# Historical behavior: run bun install during setup
- name: Install workspace dependencies
shell: bash
run: bun install --frozen-lockfile || bun install
35 changes: 35 additions & 0 deletions .github/workflows/bun-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bun Audit

on:
push:
pull_request:
workflow_call:

jobs:
bun-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run bun audit
run: bun audit --audit-level=high --json > bun-audit.json

- name: Count advisories
run: jq '.advisories | length' bun-audit.json

- name: Fail on findings
run: test "$(jq '.advisories | length' bun-audit.json)" = "0"

- name: Upload audit report
if: always()
uses: actions/upload-artifact@v4
with:
name: bun-audit-report
path: bun-audit.json
59 changes: 59 additions & 0 deletions .github/workflows/clam-av.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: av-clamav
on:
pull_request:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
actions: read

jobs:
clamav:
runs-on: ubuntu-latest
steps:
# Checkout the right ref
- name: Checkout (release tag)
if: github.event_name == 'release'
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Checkout (PR/default)
if: github.event_name != 'release'
uses: actions/checkout@v4

# Single source-of-truth build -> one file
- name: Build and package
id: build
uses: ./.github/actions/build-package

# Install fresh ClamAV DB
- name: Install & update ClamAV DB
run: |
set -e
sudo apt-get update
sudo apt-get install -y clamav clamav-freshclam unzip
sudo systemctl stop clamav-freshclam || true
sudo mkdir -p /var/lib/clamav
sudo chown -R clamav:clamav /var/lib/clamav
sudo freshclam --verbose
ls -lh /var/lib/clamav

# Scan extracted bundle so counts reflect actual files
- name: Extract bundle and scan
run: |
set -e
rm -rf scan && mkdir -p scan
unzip -q bundle/opencode.zip -d scan
echo "File count in payload: $(find scan -type f | wc -l)"
clamscan -ri --scan-archive=yes scan | tee clamav.log
! grep -q 'Infected files: [1-9]' clamav.log

- name: Upload scan results
uses: actions/upload-artifact@v4
with:
name: clamav-scan-results
path: |
clamav.log
bundle/opencode.zip
33 changes: 33 additions & 0 deletions .github/workflows/odc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: OWASP Dependency-Check

on:
push:
pull_request:
workflow_call:

jobs:
odc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate temporary npm lockfile
run: |
corepack enable
npm install --package-lock-only

- name: Run Dependency-Check
uses: dependency-check/Dependency-Check_Action@main
with:
project: ${{ github.repository }}
path: package-lock.json
format: 'HTML,JSON'
out: reports

- name: Upload Dependency-Check reports
if: always()
uses: actions/upload-artifact@v4
with:
name: odc-reports
path: reports
28 changes: 28 additions & 0 deletions .github/workflows/osv-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: OSV Scan

on:
push:
pull_request:
workflow_call:

jobs:
osv:
permissions:
contents: read
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run OSV Scanner
uses: google/osv-scanner-action@v1
with:
scan-args: --lockfile bun.lock --recursive .

- name: Upload OSV report
if: always()
uses: actions/upload-artifact@v4
with:
name: osv-report
path: osv-scanner-results.sarif
66 changes: 66 additions & 0 deletions .github/workflows/owasp-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: owasp-dependency-check
on:
pull_request:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
security-events: write

jobs:
depcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout (release tag)
if: github.event_name == 'release'
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Checkout (PR/default)
if: github.event_name != 'release'
uses: actions/checkout@v4

- name: Setup Bun (repo action)
uses: ./.github/actions/setup-bun

- name: Install workspace deps (Bun)
run: bun install --frozen-lockfile || bun install

- name: Ensure per-package node_modules (symlink to root)
run: |
set -e
root_nm="$(pwd)/node_modules"
if [ ! -d "$root_nm" ]; then echo 'No root node_modules after bun install' >&2; exit 1; fi
# create a node_modules symlink in every workspace package that lacks one
git ls-files -z | tr '\0' '\n' | grep -E '(^|/)package.json$' | while read -r pj; do
pkgdir="$(dirname "$pj")"
[ "$pkgdir" = ".github/actions/setup-bun" ] && continue
if [ ! -d "$pkgdir/node_modules" ]; then
echo "linking $pkgdir/node_modules -> $root_nm"
ln -s "$root_nm" "$pkgdir/node_modules" || true
fi
done

- name: Cache dependency-check data
uses: actions/cache@v4
with:
path: ~/.m2/repository/org/owasp/dependency-check-data/
key: depcheck-data-${{ runner.os }}-v2
restore-keys: |
depcheck-data-${{ runner.os }}-

- name: Run OWASP Dependency-Check
uses: dependency-check/Dependency-Check_Action@1.1.0
with:
project: OpenCode
path: .
format: ALL
args: --enableExperimental

- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: owasp-depcheck-report
path: reports/**
20 changes: 20 additions & 0 deletions .github/workflows/security-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Security Suite

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
bun-audit:
uses: ./.github/workflows/bun-audit.yml

osv:
needs: bun-audit
uses: ./.github/workflows/osv-scan.yml

owasp-dc:
needs: osv
uses: ./.github/workflows/odc.yml
Loading
Loading