ci(release): Fix weekly release workflow permissions - #3256
Conversation
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can route each action level your way: inline, summary, both, or drop |
PR Summary by QodoFix weekly release permissions for GitHub Packages
AI Description
High-Level Assessment
Files changed (1)
|
|
| Filename | Overview |
|---|---|
| .github/workflows/weekly-release.yml | Adds the package-write grant required by reusable toolchain builds, but grants it to unrelated workflow jobs as well. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
T[Scheduled or manual trigger] --> D[Date and change detection]
D --> G[Generals build]
D --> Z[GeneralsMD build]
G --> C[Reusable toolchain and package cache]
Z --> C
G --> R[Create release]
Z --> R
P[packages: write at workflow scope] --> D
P --> G
P --> Z
P --> R
Prompt To Fix All With AI
### Issue 1
.github/workflows/weekly-release.yml:6
**Package Permission Is Overbroad**
Declaring `packages: write` at workflow scope also grants package publication access to `get-date`, `detect-scm-changes`, and `create-release`, even though only the two reusable build jobs need it. Scope this permission to `build-generals` and `build-generalsmd` so unrelated actions and scripts do not receive an unnecessarily privileged token.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "ci(release): Fix weekly release workflow..." | Re-trigger Greptile
|
What about build-historical.yml? |
The permission mismatch applies to callers of |
|
works on manual run here: |
|
Greptile Bot noted:
|
from my understanding, this also do exist in ci.yml, and it has to do with permission "packages: write" available to every step of GitHub actions, i can fix both permissions, but its not required for this to work, at the moment! |
Adds
packages: writeto the Weekly Release workflow permissions.The reusable toolchain workflow began requesting this permission when the vcpkg binary cache moved to GitHub Packages, but the Weekly Release caller was not updated. Because explicitly omitted permissions default to
none, GitHub rejected the caller before any jobs could start.This restores the caller or callee permission contract and allows scheduled and manually dispatched weekly releases, including releases run from forks, to start normally.