Files
softharbor/.gitea/workflows/vt-recheck.yml
T
poli0981andClaude Opus 5.5 20e312b851
CI / gates (push) Successful in 49s
Reusable / Security / Secrets (gitleaks) (push) Successful in 14s
Reusable / Security / Rust (cargo-deny) (push) Skipped
Reusable / Security / .NET (NuGetAudit) (push) Skipped
Reusable / Security / SAST (Opengrep) (push) Successful in 33s
Reusable / Security / Dependencies (osv-scanner) (push) Successful in 18s
Security / security (push) Successful in 1m7s
Reusable / Qodana / Qodana (push) Successful in 3m23s
Qodana / qodana (push) Successful in 3m23s
CI / build (push) Successful in 5m29s
CI / record (push) Skipped
CI / deploy (push) Successful in 1m9s
chore(deps): upkeep 2026-12-05 — 16 non-major bumps, clear six dev-tooling advisories (#11)
Dependency upkeep for 2026-12-05. Supersedes #10.

* fix(deps): update all non-major dependencies (Renovate: actions/setup-node 7.2.0, @vite-pwa/astro 2.0.5)
* chore(deps): upkeep 2026-12-05 — 16 non-major bumps, clear six dev-tooling advisories
  astro 7.4.14, svelte 5.60.1, wrangler 4.171.0, eslint 10.16.0, knip 6.51.0, prettier 3.10.2, @playwright/test 1.65.2, @astrojs/rss 4.0.20, @astrojs/sitemap 3.7.7, eslint-plugin-astro 3.2.3, svelte-eslint-parser 1.13.0, globals 17.15.0, sharp 0.35.6, @iconify-json/lucide 1.2.163, @iconify-json/simple-icons 1.2.105.
  pnpm audit / osv-scanner now clean: cross-spawn 7.1.1 (GHSA-ghv9-86vm-4v8m critical, GHSA-m6qr-m48x-3xhh, GHSA-w3gc-668g-rf8f), ws >= 8.23.0 (GHSA-37g9-w4hg-h9qr), minimatch 11.0.10 (GHSA-3924-r96c-gp9w), terser gone from the lockfile (GHSA-6jpm-p5cq-9q44). All build/dev tooling; no override added.
* fix(e2e): size the Playwright pool by the container's CPU quota
  The ubuntu jobs moved to runner anon-docker (2026-12-04, `--cpus=4`), but os.cpus() reports the host's 28 cores, so 14 workers shared four CPUs and the axe tests timed out — main failed the same way (dispatched run 1565). playwright.config.ts reads /sys/fs/cgroup/cpu.max; no quota keeps Playwright's default.

No release: routine upkeep (docs/13 §1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 03:36:07 +00:00

186 lines
8.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docs/12 §4b — VirusTotal re-check (docs/09 §6 step 5, assisted).
#
# Daily on main: scripts/vt-recheck.mjs re-scans the entries whose check is
# due and the bot opens — or updates — ONE pull request, `vt/recheck`. While
# that PR is open, each run first carries its results over, so the next day
# continues with the next entries instead of re-scanning the same stalest
# ones (main still shows them as stale until the PR merges). A detection
# never flags anything: a `clean` entry becomes `unverified` and gets a
# tracking issue, and the maintainer decides (quarantine stays a reviewed
# `pnpm quarantine`, hard rule 5).
#
# Dispatched on any other branch it is a PREVIEW: it scans only the listed
# slugs — or, with none, the entries that were never scanned, i.e. a data
# PR's new apps — prints the patched `security` blocks in the log and keeps
# the files as the `vt-preview` artifact, for the maintainer to review and
# commit. No PR, no issues.
#
# VirusTotal's Public API allows 4 requests a minute and 500 a day (reset at
# 00:00 UTC). The script paces itself, spends at most the `budget`, and stops
# cleanly at the quota; the next run continues. The concurrency group keeps
# two runs from sharing the key's per-minute limit.
#
# On Gitea (D38): daily at 13:59 UTC (20:59 Vietnam), inside the runner's
# 13:00–16:00 UTC window (cron registry in poli0981/.github
# docs/migration/README.md). The PR, its checks and the issues go through
# scripts/gitea.mjs with the job token — see quarantine.yml for why the
# checks are dispatched and the commits unsigned.
name: vt-recheck
on:
schedule:
- cron: '59 13 * * *'
workflow_dispatch:
inputs:
slugs:
description: 'Slugs to scan first, space or comma separated (on a branch other than main: only these, or the never-scanned when empty)'
required: false
default: ''
promote:
description: "Slugs to move unverified → clean IF their scan comes back clean — the maintainer's docs/09 §6 call"
required: false
default: ''
max_age:
description: 'Re-scan checks older than this many days'
required: false
default: '90'
budget:
description: 'VirusTotal requests this run may spend (500/day; each URL costs at least 2)'
required: false
default: '440'
permissions: {}
concurrency:
group: vt-recheck
cancel-in-progress: false
jobs:
recheck:
runs-on: ubuntu-latest
# 440 requests at 15.5 s each is about two hours.
timeout-minutes: 150
permissions:
contents: write # push vt/recheck
pull-requests: write # open or update the PR
issues: write # one tracking issue per detection
actions: write # dispatch the checks onto the PR branch
env:
GITEA_API: ${{ github.api_url }}
GITEA_REPO: ${{ github.repository }}
steps:
# No persisted token while repository code runs; the push below
# authenticates on its own.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version-file: .nvmrc
# Only an OPEN pull request's results are carried: merged branches are
# deleted, and a PR closed without merging was a rejection, never to be
# re-adopted.
- name: Is a re-check PR open?
id: open
if: github.ref == 'refs/heads/main'
env:
GITEA_TOKEN: ${{ github.token }}
run: node scripts/gitea.mjs pr-open vt/recheck
- name: Carry the open re-check PR
id: carry
if: steps.open.outputs.open == 'true'
run: |
set -euo pipefail
git fetch --no-tags --depth=1 origin vt/recheck
mkdir -p "$RUNNER_TEMP/carry"
git archive FETCH_HEAD src/data/apps | tar -x -C "$RUNNER_TEMP/carry"
echo "dir=$RUNNER_TEMP/carry/src/data/apps" >> "$GITHUB_OUTPUT"
echo "tree=$(git rev-parse 'FETCH_HEAD^{tree}')" >> "$GITHUB_OUTPUT"
# Everything reaches the script through env (never `${{ }}` inside
# `run:`); it validates slugs and numbers itself.
- name: Re-check on VirusTotal
id: scan
env:
VT_API_KEY: ${{ secrets.VT_API_KEY }}
VT_SLUGS: ${{ inputs.slugs }}
VT_PROMOTE: ${{ inputs.promote }}
VT_MAX_AGE: ${{ inputs.max_age }}
VT_BUDGET: ${{ inputs.budget }}
VT_ONLY_LISTED: ${{ github.ref != 'refs/heads/main' && '1' || '' }}
VT_CARRY: ${{ steps.carry.outputs.dir }}
VT_SUMMARY: ${{ runner.temp }}/vt-summary.md
VT_REVIEW_JSON: ${{ runner.temp }}/vt-review.json
run: node scripts/vt-recheck.mjs
- name: Job summary
if: always()
run: |
if [ -f "$RUNNER_TEMP/vt-summary.md" ]; then
cat "$RUNNER_TEMP/vt-summary.md" >> "$GITHUB_STEP_SUMMARY"
fi
# ── preview (any branch but main) ─────────────────────────────────────
# The diff in the log is the review copy: an artifact needs a signed-in
# download, the log does not. Only the `security` blocks may be copied
# into the data PR (docs/12 §4b) — a whole file from the dispatch commit
# would revert later edits.
- name: Collect the preview
if: github.ref != 'refs/heads/main' && steps.scan.outputs.changed != '0'
run: |
set -euo pipefail
git --no-pager diff -- src/data/apps
mkdir -p "$RUNNER_TEMP/vt-preview"
git diff --name-only -- src/data/apps | while read -r f; do
cp --parents "$f" "$RUNNER_TEMP/vt-preview/"
done
cp "$RUNNER_TEMP/vt-summary.md" "$RUNNER_TEMP/vt-preview/"
- name: Keep the preview
if: github.ref != 'refs/heads/main' && steps.scan.outputs.changed != '0'
continue-on-error: true # the log above already holds the result
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
with:
name: vt-preview
path: ${{ runner.temp }}/vt-preview/
retention-days: 7
# ── main: one accumulating PR ─────────────────────────────────────────
# Pushed only when the branch would actually change: with a PR open, the
# carried results alone make `changed` non-zero every day.
- name: Commit and push vt/recheck
id: push
if: github.ref == 'refs/heads/main' && steps.scan.outputs.changed != '0'
env:
TOKEN: ${{ github.token }}
OLD_TREE: ${{ steps.carry.outputs.tree }}
run: |
set -euo pipefail
git config user.name 'SoftHarbor bot'
git config user.email 'actions@noreply.git.poli0981.dev'
git switch -c vt/recheck
git add src/data/apps
git commit -q -m 'data: refresh VirusTotal scans'
if [ "$(git rev-parse 'HEAD^{tree}')" = "$OLD_TREE" ]; then
echo "vt/recheck already holds these results — nothing to push."
exit 0
fi
auth=$(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)
git -c "http.extraheader=AUTHORIZATION: basic ${auth}" push -q --force origin HEAD:refs/heads/vt/recheck
echo "pushed=true" >> "$GITHUB_OUTPUT"
- name: Open or update the PR and run its checks
if: steps.push.outputs.pushed == 'true'
env:
GITEA_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
node scripts/gitea.mjs pr vt/recheck 'data: VirusTotal re-check' "$RUNNER_TEMP/vt-summary.md" security
node scripts/gitea.mjs dispatch vt/recheck ci.yml security.yml
- name: Open one tracking issue per entry with detections
if: github.ref == 'refs/heads/main' && steps.scan.outputs.review != ''
env:
GITEA_TOKEN: ${{ github.token }}
run: node scripts/gitea.mjs vt-issues "$RUNNER_TEMP/vt-review.json"