Skip to content

ci: fix reusable-workflow permissions and tighten YAML hygiene#55

Merged
sydneyrenee merged 1 commit into
mainfrom
fix/ci-yaml-hygiene
May 28, 2026
Merged

ci: fix reusable-workflow permissions and tighten YAML hygiene#55
sydneyrenee merged 1 commit into
mainfrom
fix/ci-yaml-hygiene

Conversation

@sydneyrenee
Copy link
Copy Markdown
Member

@sydneyrenee sydneyrenee commented May 28, 2026

Summary

_build.yml declared permissions: contents: write at the workflow level. Reusable workflows cannot request more than the caller grants, so when ci.yml (which grants contents: read) called it, GitHub rejected with:

Error calling workflow ... is requesting 'contents: write', but is only allowed 'contents: read'.

Drop the workflow-level permissions block from _build.yml so it inherits the caller's permissions — ci.yml provides read (verification builds, no release upload), publish.yml provides write (release-asset upload via tauri-action).

While here, apply YAML hygiene based on the official Actions docs and reference workflows in cli/cli, tauri-apps/tauri, and actions/toolkit:

  • Title-case name: and run-name: (CI, Build) so the Actions UI is consistent with the existing Publish and CodeQL workflows.
  • Per-job permissions: with least-privilege: each job declares only what it needs (contents: read for build, security-events: write only on the CodeQL analyze job).
  • timeout-minutes: on every job (5 for the trivial version compute, 20 for the CLI cross-compile, 60 for CodeQL analyze, 90 for the Tauri matrix legs). Avoids 6-hour stalls on hung runners.
  • name: on every step with Title Case imperative verbs ("Checkout", "Setup Bun", "Install Rust toolchain"). Replaces opaque "Run …" entries in the UI.
  • github.token over secrets.GITHUB_TOKEN for consistency with the rest of _build.yml, which already uses the canonical form.
  • Drop dead continue-on-error: false (it's the default).
  • version-job step id renamed vcompute for readability when grepping for the output reference.

actionlint is clean on all three modified files. No behavioral changes beyond the permissions fix.

Test plan

  • After merge, the Run workflow button on CI in the Actions UI dispatches successfully against main.
  • First CI run goes green (or at least makes it past the _build.yml call site, which is what was failing before).
  • Publish workflow still works when manually dispatched (it grants contents: write, so this should be unaffected).

The build workflow could not be invoked from ci.yml because _build.yml
declared workflow-level `permissions: contents: write` while ci.yml only
granted `contents: read`. Reusable workflows cannot request more than
the caller grants; remove the workflow-level block so _build.yml
inherits caller permissions (read from ci.yml, write from publish.yml).

While here, apply 2025-era GitHub Actions hygiene per docs and
reference workflows in cli/cli, tauri/tauri, actions/toolkit:

- Title-case `name:` and `run-name:` for consistency with Publish/CodeQL
- Per-job `permissions:` blocks (least-privilege)
- `timeout-minutes:` on every job (5 / 20 / 60 / 90)
- `name:` on every step; Title Case imperative verbs
- Drop dead `continue-on-error: false`
- Use `${{ github.token }}` over `${{ secrets.GITHUB_TOKEN }}` consistently
- Move CodeQL's `security-events: write` to the analyze job only
- Rename `version`-job step id from `v` to `compute` for readability

No behavioral changes beyond the permissions fix.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sydneyrenee sydneyrenee merged commit 82101c8 into main May 28, 2026
8 of 10 checks passed
@sydneyrenee sydneyrenee deleted the fix/ci-yaml-hygiene branch May 28, 2026 02:11
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