fix(ci): grant callees the permissions they declare, unpin the audit build

Three failures from the first push, all of them CI configuration rather
than code.

CodeQL and CI/Node both hit startup_failure with no logs. A caller cannot
grant a called workflow less than its jobs declare, and the run is
rejected before anything starts, so there is nothing to read.
reusable-codeql.yml's analyze job asks for `packages: read` to fetch
CodeQL packs, and reusable-web-react.yml's deploy job asks for `pages:
write` and `id-token: write`. The deploy job is skipped here
(deploy-pages: false), but permissions are validated at startup
regardless of `if:`.

This is the trap RELEASE-CI.md section 1 already records -- "callers
without a permissions block default everything to none" -- met from the
other direction: having a block is not enough if it grants less than the
callee asked for. Both comments now say so at the point of use.

cargo audit failed to compile rather than finding an advisory.
rustsec/audit-check builds cargo-audit from source, and
rust-toolchain.toml pinned that build to PipDock's 1.94.1; cargo-audit's
own dependency tree needs 1.96. The job now builds it with stable, which
is correct in principle too: the pin exists to make PipDock reproducible,
not its tooling, and cargo-audit only reads Cargo.lock.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5 committed 2026-07-27 20:33:27 +07:00
1 parent 779c1e8560
commit c3fc8e4f5a
3 files changed
+18 -1

No files matched your search

+5
View File
@@ -14,8 +14,13 @@ on:
push:
branches: [main]
# The reusable declares a Pages-deploy job needing `pages: write` and `id-token: write`. It is
# skipped here (`deploy-pages: false`), but permissions are validated at startup regardless of
# `if:`, so a caller that grants less than the callee declares is rejected before it runs.
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ci-node-${{ github.ref }}
+8 -1
View File
@@ -61,12 +61,19 @@ jobs:
name: cargo audit
runs-on: ubuntu-latest
timeout-minutes: 15
env:
# The action builds cargo-audit from source, and rust-toolchain.toml would otherwise pin
# that build to PipDock's toolchain. cargo-audit's own dependency tree already requires a
# newer rustc than we pin (kstring needs 1.96), so the audit failed to compile rather than
# finding anything. It only reads Cargo.lock, so building it with stable is correct — the
# pin exists to make *PipDock* reproducible, not its tooling.
RUSTUP_TOOLCHAIN: stable
steps:
- name: Checkout
uses: actions/checkout@v7
# RustSec advisories against the committed Cargo.lock. Split from the Windows job because
# it needs no toolchain pin and no target build — it is a lockfile scan.
# it needs no target build — it is a lockfile scan.
- name: Audit
uses: rustsec/audit-check@v2
with:
+5
View File
@@ -18,9 +18,14 @@ on:
# Weekly, offset off the hour to avoid the top-of-hour scheduling pileup.
- cron: '37 4 * * 1'
# A caller cannot grant a called workflow less than its jobs declare, or the run is rejected before
# it starts. reusable-codeql.yml's analyze job asks for `packages: read` to fetch internal CodeQL
# packs, so omitting it here produced a startup_failure with no logs to explain it — the same
# permissions trap RELEASE-CI.md §1 records, from the other direction.
permissions:
actions: read
contents: read
packages: read
security-events: write
jobs: