Skip to content

Commit 403709a

Browse files
committed
ci: remove third‑party setup actions in PR scan; install Bun/Rust via shell
- Replace oven-sh/setup-bun with curl installer and PATH export - Drop pnpm/action-setup; use corepack to activate pnpm/yarn - Replace dtolnay/rust-toolchain with rustup bootstrap - Add defaults.run.shell: bash; small permissions tweaks - Keep Go using first‑party actions/setup-go@v5 - Include schedule in release job guard to avoid skipped runs
1 parent 72dbdb9 commit 403709a

1 file changed

Lines changed: 25 additions & 24 deletions

File tree

.github/workflows/clam-av-scan.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
- cron: "0 3 * * 1"
1414
permissions:
1515
contents: read
16+
actions: read
17+
18+
defaults:
19+
run:
20+
shell: bash
1621

1722
jobs:
1823
clamav-pr:
@@ -33,35 +38,28 @@ jobs:
3338
echo "has_go=$([ -f go.mod ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
3439
3540
# --- JavaScript path (Bun/Node) ---
36-
- name: Setup Bun
41+
- name: Setup Bun (no external action)
3742
if: steps.meta.outputs.has_bun_lock == 'true'
38-
uses: oven-sh/setup-bun@v1
39-
with:
40-
bun-version: '1.x'
41-
42-
- name: Setup Node
43-
if: steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
44-
uses: actions/setup-node@v4
45-
with:
46-
node-version: '20'
43+
run: |
44+
curl -fsSL https://bun.sh/install | bash
45+
echo "$HOME/.bun/bin" >> $GITHUB_PATH
46+
bun --version
4747
48-
- name: Enable Corepack (Node)
48+
- name: Setup Node via corepack (fallback when not Bun)
4949
if: steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
5050
run: |
51+
sudo apt-get update -y
52+
sudo apt-get install -y nodejs npm || true
5153
npm i -g corepack || true
5254
corepack enable || true
5355
if [ "${{ steps.meta.outputs.has_yarn_lock }}" = "true" ]; then corepack prepare yarn@stable --activate || true; fi
54-
55-
- name: Setup pnpm
56-
if: steps.meta.outputs.has_pnpm_lock == 'true' && steps.meta.outputs.has_bun_lock != 'true'
57-
uses: pnpm/action-setup@v4
58-
with:
59-
version: 9
56+
if [ "${{ steps.meta.outputs.has_pnpm_lock }}" = "true" ]; then corepack prepare pnpm@9 --activate || true; fi
57+
node -v || true
58+
corepack -v || true
6059
6160
- name: Install deps (Bun)
6261
if: steps.meta.outputs.has_bun_lock == 'true'
6362
run: |
64-
bun --version
6563
bun install --frozen-lockfile || bun install || true
6664
6765
- name: Build (Bun)
@@ -79,18 +77,21 @@ jobs:
7977
- name: Build (Node)
8078
if: steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
8179
run: |
82-
pnpm run -c build || pnpm -r build || pnpm -w build || npm run build || yarn build || true
80+
pnpm run -c build || pnpm -r build || pnpm -w build || \n npm run build || yarn build || true
8381
84-
# --- Rust path ---
85-
- name: Setup Rust
82+
# --- Rust path (no external action) ---
83+
- name: Setup Rust (rustup)
8684
if: steps.meta.outputs.has_cargo == 'true'
87-
uses: dtolnay/rust-toolchain@stable
85+
run: |
86+
curl https://sh.rustup.rs -sSf | sh -s -- -y
87+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
88+
rustc --version || true
8889
8990
- name: Build (Rust)
9091
if: steps.meta.outputs.has_cargo == 'true'
9192
run: cargo build --release || true
9293

93-
# --- Go path ---
94+
# --- Go path (first-party action ok) ---
9495
- name: Setup Go
9596
if: steps.meta.outputs.has_go == 'true'
9697
uses: actions/setup-go@v5
@@ -137,7 +138,7 @@ jobs:
137138
dist-pr/scan.tgz
138139
139140
clamav-scan:
140-
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
141+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
141142
name: ClamAV scan (release assets)
142143
runs-on: ubuntu-latest
143144
permissions:

0 commit comments

Comments
 (0)