Skip to content

ci: drop top-level contents write from smoke workflows - #95

Merged
c-vigo merged 1 commit into
devfrom
bugfix/94-smoke-workflow-token-permissions
Jul 15, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/94-smoke-workflow-token-permissions

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What

Restrict the default GITHUB_TOKEN to none at workflow scope in e2e-smoke.yml and published-tag-smoke.yml, declaring contents: write on the single job instead (needed for the scratch-branch push and the commit the action under test creates via the API). Same layout as codeql.yml / scorecard.yml / sync-issues.yml.

Why

Scorecard's TokenPermissions check scores 0 whenever any workflow grants a write permission at workflow scope — these two were the only remaining top-level writes. Fixing them closes code-scanning alerts #27 and #23 and lifts the check score off zero. The remaining job-level write alerts in the release pipeline are tracked separately (out of scope here; several of those files are devkit-managed).

Verification

  • Full pre-commit suite green locally (prek run --all-files).
  • actionlint clean for this diff (the two steps.commit.outputs warnings it reports are pre-existing on dev, unrelated).
  • e2e-smoke runs on this PR (pull_request → dev) — exercises the job-level token end-to-end.
  • published-tag-smoke to be dispatched on this branch with ref=v0.3.0 after the PR opens.

Refs: #94

Scorecard's TokenPermissions check scores 0 when any workflow grants a
write permission at workflow scope. e2e-smoke and published-tag-smoke
only need contents: write inside their single job (scratch-branch push
plus the commit the action under test creates), so restrict the default
token to none and declare the write on the job, matching the
codeql/scorecard/sync-issues layout. Closes code-scanning alerts #27
and #23.

Refs: #94
@c-vigo

c-vigo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Verification results:

  • All PR checks green, including E2E Smoke (12s) — exercises the new job-level contents: write end-to-end on this branch.
  • published-tag-smoke dispatched from this branch with ref=v0.3.0: first run 29433505922 failed in the verify step, but not because of this change — the released action produced a signed commit (b62515ff, verification.verified: true, correct parent/message); the verify step's branch-head read ~1s later returned a stale value (API read-after-write lag). Re-dispatch 29433677039 passed unchanged. The race is latent in both smoke workflows' verify steps (they read the branch head immediately after the action returns) and predates this PR; a bounded retry poll there is a candidate follow-up.

@c-vigo
c-vigo merged commit 63d951b into dev Jul 15, 2026
14 of 15 checks passed
@c-vigo
c-vigo deleted the bugfix/94-smoke-workflow-token-permissions branch July 15, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant