Skip to content

fix: scope generated workflow permissions - #1284

Merged
exKAZUu merged 4 commits into
mainfrom
fix/workflow-permission-scoping
Aug 30, 2026
Merged

exKAZUu merged 4 commits into
mainfrom
fix/workflow-permission-scoping

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Customer Summary

  • Reduces GitHub Actions token access for generated Rust test, PR validation, and close-comment workflows.
  • Preserves unrelated jobs in customized workflow files and removes stale extra permissions from managed callers.
  • Keeps generated workflow files stable across repeated wbfy runs.

Technical Summary

  • Canonicalizes exact job-level permissions by parsed @main reusable-workflow call, including nonstandard filenames and job names.
  • Leaves pinned reusable-workflow revisions unchanged and preserves sibling inline jobs.
  • Adds a system-boundary generator test covering stale grants, noncanonical callers, sibling preservation, and canonical output.
  • Documents the caller-job permission contract and aligns this repository's own generated callers.

Why

  • Workflow-level permissions could unintentionally narrow sibling jobs, while deep-merged job permissions could retain excessive scopes.
  • Centralizing canonicalization at the parsed caller boundary enforces least privilege without affecting unrelated jobs.

Testing

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the security posture of the project's CI/CD pipeline by scoping GitHub Actions token permissions. By explicitly defining the required permissions for each reusable workflow caller, the risk associated with over-privileged tokens is reduced. The changes include updates to the workflow generator logic, corresponding documentation, and a new test suite to ensure ongoing compliance with these security requirements.

Highlights

  • Minimal Token Permissions: Updated generated GitHub Actions workflows to use the principle of least privilege by explicitly defining minimal token permissions for test-rust, semantic-pr, and close-comment callers.
  • Documentation Update: Updated the repository rules documentation to reflect the new permission contract for reusable workflow callers.
  • Automated Verification: Added a new unit test to verify that generated workflow files correctly contain the expected permission configurations.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/close-comment.yml
    • .github/workflows/semantic-pr.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


Permissions tight and locked away, / To keep the workflows safe all day. / With minimal scope for every task, / Security is all we ask.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the workflow generator to explicitly define and restrict GitHub Actions token permissions for generated reusable workflow callers (test-rust, semantic-pr, and close-comment). It also updates the expected repository rules documentation to reflect these permission requirements and adds a unit test to verify that the generated workflows grant only the necessary permissions. I have no feedback to provide as there are no review comments and the changes align with the repository guidelines.

exKAZUu and others added 3 commits August 30, 2026 12:50
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Aug 30, 2026
@exKAZUu
exKAZUu merged commit 9fa7fae into main Aug 30, 2026
5 checks passed
@exKAZUu
exKAZUu deleted the fix/workflow-permission-scoping branch August 30, 2026 10:44
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