|
5 | 5 | permissions: |
6 | 6 | contents: read |
7 | 7 |
|
8 | | -defaults: |
9 | | - run: |
10 | | - shell: bash |
11 | | - |
12 | 8 | jobs: |
13 | 9 | clamav-pr: |
14 | 10 | runs-on: ubuntu-latest |
15 | 11 | steps: |
16 | 12 | - uses: actions/checkout@v4 |
17 | 13 |
|
18 | | - - name: Setup Bun |
19 | | - uses: ./.github/actions/setup-bun |
20 | | - |
21 | | - - name: Verify Bun |
22 | | - run: bun --version |
23 | | - |
24 | | - - name: Install dependencies (Bun) |
25 | | - run: bun install --frozen-lockfile || bun install |
26 | | - |
27 | | - - name: Build (Bun) |
28 | | - run: bun run build |
| 14 | + - name: Build and package |
| 15 | + id: build |
| 16 | + uses: ./.github/actions/build-package |
29 | 17 |
|
30 | | - - name: Package build outputs |
31 | | - run: | |
32 | | - set -e |
33 | | - rm -rf dist-pr/payload |
34 | | - mkdir -p dist-pr/payload |
35 | | - rsync -a --exclude '.git' --exclude '.github' --exclude 'node_modules' ./ dist-pr/payload/ |
36 | | - tar -czf dist-pr/scan.tgz -C dist-pr/payload . |
37 | | - ls -lh dist-pr/scan.tgz |
| 18 | + - name: Upload build bundle |
| 19 | + uses: actions/upload-artifact@v4 |
| 20 | + with: |
| 21 | + name: opencode-bundle |
| 22 | + path: bundle/opencode.zip |
38 | 23 |
|
39 | 24 | - name: Install & update ClamAV DB |
40 | 25 | run: | |
41 | 26 | set -e |
42 | 27 | sudo apt-get update |
43 | | - sudo apt-get install -y clamav clamav-freshclam |
| 28 | + sudo apt-get install -y clamav clamav-freshclam unzip |
44 | 29 | sudo systemctl stop clamav-freshclam || true |
45 | 30 | sudo mkdir -p /var/lib/clamav |
46 | 31 | sudo chown -R clamav:clamav /var/lib/clamav |
47 | 32 | sudo freshclam --verbose |
48 | 33 | ls -lh /var/lib/clamav |
49 | 34 |
|
50 | | - - name: ClamAV scan (extract and scan all files) |
| 35 | + - name: Extract bundle and scan |
51 | 36 | run: | |
52 | 37 | set -e |
53 | | - mkdir -p dist-pr/extracted |
54 | | - tar -xzf dist-pr/scan.tgz -C dist-pr/extracted |
55 | | - echo 'File count in payload: '$(find dist-pr/extracted -type f | wc -l) |
| 38 | + rm -rf dist-pr/extracted && mkdir -p dist-pr/extracted |
| 39 | + unzip -q bundle/opencode.zip -d dist-pr/extracted |
| 40 | + echo "File count in payload: $(find dist-pr/extracted -type f | wc -l)" |
56 | 41 | clamscan -ri --scan-archive=yes dist-pr/extracted | tee clamav-pr.log |
57 | 42 | ! grep -q 'Infected files: [1-9]' clamav-pr.log |
58 | 43 |
|
|
62 | 47 | name: clamav-pr-scan-results |
63 | 48 | path: | |
64 | 49 | clamav-pr.log |
65 | | - dist-pr/scan.tgz |
| 50 | + bundle/opencode.zip |
0 commit comments