Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
6b96d74
ci: ignore
thdxr Jun 27, 2025
240cb99
ci: ignore
thdxr Jun 27, 2025
0aa9209
fix: unawaited promise causes opencode to use unenabled formatter (#625)
rekram1-node Jul 2, 2025
16dc215
fix: typescript error (#618)
timoclsn Jul 3, 2025
f05aa93
ignore: ci
thdxr Jul 19, 2025
4eeb30f
ci: ignore
thdxr Jul 19, 2025
995d428
Add opencode workflow
fwang Aug 24, 2025
9ba1d12
Add opencode workflow
fwang Aug 24, 2025
0ddf87d
Add opencode workflow
fwang Aug 24, 2025
57e3aa6
Add opencode workflow
fwang Aug 25, 2025
9495401
Add opencode workflow
fwang Aug 25, 2025
402937f
add threat scanning workflows
riatzukiza Oct 24, 2025
4eccc1a
adjusted event triggers
riatzukiza Oct 24, 2025
ba866b1
reverting accidental edit
riatzukiza Oct 24, 2025
6425c63
ci: guard AV workflows on PRs + robust tag resolution
riatzukiza Oct 24, 2025
06127b2
ci: enable PR/push AV scans (no releases required)
riatzukiza Oct 24, 2025
c96006b
ci: add heuristic build steps to PR ClamAV job (Node/Rust/Go)
riatzukiza Oct 24, 2025
f4d2191
ci: harden heuristic PR build (corepack, non-fatal builds, tarball)
riatzukiza Oct 24, 2025
e475ff6
ci: add Bun (bun.lockb) support to PR build (Ubuntu)
riatzukiza Oct 24, 2025
12f01e4
ci: remove third‑party setup actions in PR scan; install Bun/Rust via…
riatzukiza Oct 24, 2025
e81d21d
ci: add minimal smoke workflow (ubuntu/windows/macos) to diagnose sta…
riatzukiza Oct 24, 2025
5c8ddd4
removeed push action
riatzukiza Oct 24, 2025
b5cd1da
yaml error
riatzukiza Oct 24, 2025
b0c8760
removed useless smoke test
riatzukiza Oct 24, 2025
9616dbc
ci: fix scanners (owasp dep-check action pin, clamav DB init, windows…
riatzukiza Oct 24, 2025
51243ee
ci(owasp,defender): fix dep-check inputs (no 'out'; use format=ALL + …
riatzukiza Oct 24, 2025
f3e76be
ci(clamav): detect bun/node/rust/go across repo; only run node when n…
riatzukiza Oct 24, 2025
10f3718
ci(defender): avoid Compress-Archive lock by zipping to %RUNNER_TEMP%…
riatzukiza Oct 24, 2025
0084336
ci(defender-pr): scan directory instead of the zip to avoid archive-s…
riatzukiza Oct 24, 2025
43aa94f
ci(owasp): prep dependencies (bun or node) so ODC sees installed modu…
riatzukiza Oct 24, 2025
eb0a7ff
ci(defender-pr): fix scan_root propagation (use step outputs) and add…
riatzukiza Oct 24, 2025
86bcad0
ci(clamav-pr): build with Bun per README/workflows (no language detec…
riatzukiza Oct 24, 2025
af4a611
ci(clamav release): build with Bun (single build per README), package…
riatzukiza Oct 24, 2025
f629d27
ci(clamav): use local setup-bun action per repo docs; split PATH appl…
riatzukiza Oct 24, 2025
41bc7c4
build: add composite action to build with Bun and package single zip …
riatzukiza Oct 24, 2025
2ab5a39
ci(clamav-pr): use shared build-package composite; produce single bun…
riatzukiza Oct 24, 2025
9ac72bc
ci(clamav-release): consume shared build-package; scan extracted bund…
riatzukiza Oct 24, 2025
7a1dbc8
ci(defender): depend on shared build-package; download single opencod…
riatzukiza Oct 24, 2025
f7678d9
ci(clamav): unify into single workflow .github/workflows/clam-av.yml;…
riatzukiza Oct 24, 2025
ebfd8c6
build(composite): use bunx turbo run build (root build script not pre…
riatzukiza Oct 24, 2025
7411323
ci(owasp): bun monorepo support — setup via local action, bun install…
riatzukiza Oct 24, 2025
99c989c
ci(setup-bun): pin default Bun to 1.3.0 to satisfy strict build scrip…
riatzukiza Oct 24, 2025
f074c78
ci(bun): restore setup-bun default to 'latest' to avoid breaking exis…
riatzukiza Oct 24, 2025
dd87056
Delete .github/workflows/clam-av-scan.yml
riatzukiza Oct 24, 2025
e026325
Delete .github/workflows/clam-av-pr.yml
riatzukiza Oct 24, 2025
5288d72
chore(format): use `bunx prettier` instead of `bun run prettier` (no …
riatzukiza Oct 24, 2025
11cadb9
ci(setup-bun): restore legacy behavior — run `bun install` inside set…
riatzukiza Oct 25, 2025
78073c7
ci: pin Bun to 1.3.0 globally in setup-bun (with install step) and re…
riatzukiza Oct 25, 2025
4421019
ci(defender): force Bun 1.3.0 in build-package; ensure build job emit…
riatzukiza Oct 25, 2025
45d7244
nope
riatzukiza Oct 25, 2025
b789a33
so we may have needed that one
riatzukiza Oct 25, 2025
0bf278b
I can read
riatzukiza Oct 25, 2025
03d5b35
oops
riatzukiza Oct 25, 2025
555122f
????
riatzukiza Oct 25, 2025
1d84b7b
specify bun version file for setup-bun action
riatzukiza Oct 25, 2025
2c63794
I can definitely read
riatzukiza Oct 25, 2025
324ac4a
lock in bun version
riatzukiza Oct 25, 2025
5a470e8
be specific
riatzukiza Oct 25, 2025
4dfa530
add bun version to hash function
riatzukiza Oct 25, 2025
123c024
stuff
riatzukiza Oct 25, 2025
c46da63
ci(setup-bun): make cache version-strict & self-invalidating; clear ~…
riatzukiza Oct 25, 2025
5bf0c95
ci(setup-bun): read version from .bun-version and disable tool-cache;…
riatzukiza Oct 25, 2025
e731b8b
Kill robot fantasy
riatzukiza Oct 25, 2025
30f2a83
well then
riatzukiza Oct 25, 2025
0c38456
EICAR string test
riatzukiza Oct 25, 2025
d7d33b5
ooops
riatzukiza Oct 25, 2025
eaaa277
trying to trigger security check
riatzukiza Oct 25, 2025
eb09a2c
it should only pass if it fails
riatzukiza Oct 25, 2025
c83cbd2
robot's don't want you to be safe
riatzukiza Oct 25, 2025
448e27d
Won't work in github ci
riatzukiza Oct 25, 2025
dff9c07
Add polling for Defender detections
riatzukiza Oct 26, 2025
3d9eaf3
Update .github/workflows/clam-av.yml
riatzukiza Oct 26, 2025
e8f2084
Add on-demand Defender scan for EICAR verification
riatzukiza Oct 26, 2025
f658d8b
Ensure ClamAV workflow validates EICAR detection
riatzukiza Oct 26, 2025
57bf2db
Ensure ClamAV workflow validates EICAR detection
riatzukiza Oct 26, 2025
73dfbda
Adjust Defender EICAR wait
riatzukiza Oct 29, 2025
7fec270
Allow ClamAV workflow to tolerate EICAR detections
riatzukiza Oct 29, 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
82 changes: 82 additions & 0 deletions .github/workflows/clam-av.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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: Verify ClamAV detects EICAR signature
run: |
set -euo pipefail
printf 'X5O!P%%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.com
status=0
clamscan eicar.com > eicar.log || status=$?
cat eicar.log
if [ "$status" -ne 1 ]; then
echo "ClamAV failed to report the EICAR signature" >&2
exit 1
fi
grep -q 'eicar.com: Eicar-Test-Signature FOUND' eicar.log
grep -q 'Infected files: 1' eicar.log
rm -f eicar.com eicar.log

- name: Extract bundle and scan
run: |
set -euo pipefail
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
if grep -qE 'Infected files: [1-9][0-9]*' clamav.log; then
findings=$(grep 'FOUND' clamav.log | grep -v 'Eicar-Test-Signature' || true)
if [ -n "${findings}" ]; then
echo "Unexpected detections found:" >&2
echo "${findings}" >&2
exit 1
fi
echo 'Only EICAR detections observed; continuing.'
fi

- name: Upload scan results
uses: actions/upload-artifact@v4
with:
name: clamav-scan-results
path: |
clamav.log
bundle/opencode.zip
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/**
Loading