Repository navigation
Conversation
GitHub omits bypass_actors from a ruleset response when the caller cannot administer the ruleset, and returns an empty array when an admin reads a ruleset without bypass actors. Read wrote an empty list in both cases, so a plan with a read-only token always proposed adding the configured actors. Fixes integrations#3687
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
|
This would be awesome, not having this makes it harder for us to have a proper secure way to manage our repos with terraform |
|
Thanks for putting this PR together and taking the time to contribute! We're temporarily moving to an issue-first model (see CONTRIBUTING.md) where only collaborators can open PRs while we work through the backlog. Because of that, I'm going to close this PR for now. I've linked it on #3687 so we don't lose your work or context when we pick that issue up. Feel free to add a 👍 or any extra notes there to help us prioritize it. |
Resolves #3687
Before the change?
bypass_actorsfrom a ruleset response when the caller cannot administer the ruleset.Readwrote an empty list in that case, so a plan run with a read-only token always proposed adding the configured bypass actors.After the change?
Readleavesbypass_actorsin state untouched when the response omits the key. An explicit"bypass_actors": [], which an admin caller receives for a ruleset without bypass actors, still clears state, so drift detection for admin callers is unchanged.github_repository_rulesetandgithub_organization_ruleset.AI use
This change and its tests were written with an AI coding assistant (Claude Code) and reviewed by me before submitting. The omitted-versus-empty behaviour was checked against the live API with an admin and a non-admin token: the non-admin response has no
bypass_actorskey, while the admin response has"bypass_actors": []for a ruleset without bypass actors. The new unit tests fail without the change and pass with it.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!