fix(ci): Restore CI workflow permission compatibility - #3286
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoRestore caller-owned permissions for reusable CI workflows
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
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 start a comment with 'qodo' or '@qodo' to chat about any finding |
|
| Filename | Overview |
|---|---|
| .github/workflows/ci.yml | Updates reusable workflow references and explicitly grants read permission to replay checks. |
| .github/workflows/build-historical.yml | Reduces workflow-wide permissions and scopes contents write access to the release job. |
| .github/workflows/reusable-build-toolchain.yml | Renames the build workflow and documents that callers must declare required permissions. |
| .github/workflows/reusable-check-replays.yml | Removes incompatible reusable-workflow permission declarations and documents the caller requirement. |
| .github/workflows/weekly-release.yml | Updates release build jobs to invoke the renamed reusable build workflow. |
Reviews (2): Last reviewed commit: "fix(ci): Make reusable workflow permissi..." | Re-trigger Greptile
|
I do not understand the leading underscore. Is this a github convention or just made up here? |
Since we cannot put the reusable workflows in a subfolder, I thought it would be good to differentiate them like this. It's a convention used by some other projects too. |
|
It is unclear how a third party will derive this convention from the file name. Maybe add a named prefix to the files instead that clarifies the goal? |
There was a problem hiding this comment.
🔵 Needs a closer look
CI permission and reusable-workflow inheritance behavior cannot be fully validated in this sandbox and warrants a human confirming the live workflow runs, even though the changes appear complete and correct.
Pull request overview
This PR restores CI (GenCI) compatibility after #3276 broke the replay workflow. It formalizes the pattern that reusable workflows do not declare their own permissions and instead inherit them from the calling job. Reusable workflows are renamed with a leading _, their required permissions are documented in header comments, and each caller job now grants exactly the permissions it needs (including a newly added contents: read on the replay-check job that previously caused a startup failure by requesting pull-requests: write it wasn't granted). It also narrows build-historical.yml so contents: write is only granted to the release job.
Changes:
- Renamed reusable workflows to
_build-toolchain.yml/_check-replays.ymland updated alluses:references inci.ymlandweekly-release.yml. - Removed permission declarations from the reusable workflows (replacing them with documentation comments) and added
permissions: contents: readto thereplaycheck-generalsmdcaller job. - Scoped
build-historical.ymlto top-levelcontents: read, grantingcontents: writeonly to thecreate-releasejob.
File summaries
| File | Description |
|---|---|
.github/workflows/ci.yml |
Points to _-prefixed reusable workflows and adds contents: read to the replay-check job. |
.github/workflows/weekly-release.yml |
Updates uses: references to the renamed _build-toolchain.yml. |
.github/workflows/build-historical.yml |
Moves contents: write from workflow level to the create-release job only; top-level becomes contents: read. |
.github/workflows/_check-replays.yml |
Renamed reusable workflow; removes permissions (incl. pull-requests: write) in favor of caller-declared permissions with a documenting comment. |
.github/workflows/_build-toolchain.yml |
Renamed reusable workflow; replaces permissions note with a WARNING documenting caller-granted permissions. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
40045cc to
9dbdd08
Compare
Changed to use |
This restores GenCI after #3276 broke the replay workflow by requesting
pull-requests: write, while the caller did not grant it.Reusable workflows now inherit permissions from explicit caller declarations. Their filenames start with
reusable-, and the required permissions are documented in the workflow header.Historical builds only get write permissions when creating a release.
Tested on my fork, result looks good: https://github.com/tintinhamans/GeneralsGameCode/actions/runs/34748506756