Repository navigation
fix(workspace): render codeql push paths per detected language - #1147
Merged
Merged
Conversation
11 tasks done
c-vigo
added a commit
that referenced
this pull request
Jul 16, 2026
## Description The scaffolded `release.yml` calls the consumer-owned `release-extension.yml` seam, but its `extension` caller job declared **no** `permissions:` block, so the called reusable workflow ran under the caller's workflow-level default (`contents: read, packages: read`). A called reusable workflow can only *downgrade* the caller's `GITHUB_TOKEN` — never elevate it — so any write-scoped extension step was silently denied: - `actions/attest-build-provenance` (needs `id-token: write` + `attestations: write`) — the flow that surfaced this during the sync-issues-action adoption (vig-os/sync-issues-action#106). - Even the **GHCR-publish example the docs already ship** (needs `packages: write`) — blocked by the same read-only ceiling. ## Type of Change - [x] `feat` -- New feature ## Changes Made Option A from the issue — raise the ceiling and document it: - **`assets/workspace/.github/workflows/release.yml`** — the `extension` caller job now declares a documented token **ceiling**: `contents: read`, `packages: write`, `id-token: write`, `attestations: write`. - **`assets/workspace/.github/workflows/release-extension.yml`** (seeded/consumer-owned) — header note explaining the ceiling and the per-job opt-in; the default no-op stays `contents: read`. - **`docs/DOWNSTREAM_RELEASE.md`** — new "Permission ceiling" subsection (scope table + deny-by-default explanation + when to use a consumer-owned tag-push workflow instead). **Ceiling, not grant.** It's the *maximum* the seam can reach; the shipped default no-op is read-only and deny-by-default is preserved — a consumer opts a job in by declaring the scopes it needs (up to the ceiling), e.g. a `actions/attest-build-provenance` job sets `permissions: { id-token: write, attestations: write }`. Scopes beyond the ceiling (e.g. `contents: write` to push a branch) still belong in a consumer-owned tag-push workflow — documented. Scope note: this is scaffold-only. Devkit's own `release.yml` is a bespoke upstream pipeline and does not use the `release-extension.yml` seam, so there's no dogfooding copy to change. ## Changelog Entry ### Changed - **Release extension seam gains a documented token ceiling** ([#1144](#1144)) - full entry in `CHANGELOG.md` under `## Unreleased`. ## Testing - [x] Tests pass locally (`just test`) - [x] Manual testing performed (describe below) ### Manual Testing Details - New `tests/test_workflow_release_extension.py` (TDD, RED→GREEN): asserts the caller ceiling grants the four scopes **and** the default no-op stays read-only (ceiling ≠ grant). - `uv run pytest -k "workflow or scaffold or release or downstream or extension"` → **109 passed**; `actionlint` clean on the edited workflow (only the expected cross-tree reusable-path notes); full `prek run --all-files` **green**. - Manifest sync propagated the doc into `assets/workspace/docs/` (mirror test green). ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly - [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and pasted the entry above) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective - [x] New and existing unit tests pass locally with my changes ## Additional Notes Companion to #1147 (#1142); both surfaced during the sync-issues-action deploy recon. The workaround shipping there today (`attest-release.yml` on `push: tags: v*.*.*`) remains valid — this makes the in-seam path work too, so future consumers can keep provenance attestation inside `release-extension.yml`. Closes #1144 Refs: #1144
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
render_codeql_matrix()(assets/init-workspace.sh) rewrites the CodeQLlanguage:matrix per detected language (#1025) but left the push-to-maintrigger's
paths:filter hardcoded to**.py. On a Node consumer, a pushtouching only TS/JS therefore never fired the post-merge CodeQL scan — only the
unfiltered PR trigger caught it. And because
codeql.ymlis a managed file,consumer hand-fixes (e.g. commit-action's
**.tspatch, vig-os/commit-action#67)were silently reverted on every devkit upgrade.
Type of Change
fix-- Bug fixChanges Made
render_codeql_matrix()to build the pushpaths:list from the samelanguage detection it already uses for the matrix:
'**.py''**.ts','**.js','**.mjs','**.cjs''.github/workflows/**'catch-all is always keptpaths:block withawk(the item count varies per language, soa single
sedline-replace can't do it); the language matrix render isunchanged.
Changelog Entry
Fixed
paths:filter per detected language (#1142)CHANGELOG.mdunder## Unreleased.Testing
just test)Manual Testing Details
bats tests/bats/init-workspace.bats→ 212/212 pass (4 new [BUG] Scaffold codeql.yml push paths hardcoded to '**.py' — not rendered per language, consumer hand-fixes lost on upgrade #1142 tests + theexisting [BUG] Scaffold codeql.yml: hardcoded python matrix + conflicts with GitHub default code-scanning setup #1025 matrix tests).
on.push.pathsblock lists
**.ts/**.js/**.mjs/**.cjs+.github/workflows/**withclean YAML indentation.
shellcheck -x assets/init-workspace.shclean; fullprek run --all-filesgreen.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Found during the sync-issues-action deploy recon — affects every JS-action
consumer (commit-action today, sync-issues-action next). With this merged,
deploys no longer need to re-patch
codeql.ymlby hand after each scaffold sync.Closes #1142
Refs: #1142