You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: github_repository_environment: can_admins_bypass = false is silently not applied on Pro/Team private repos #3760
The environment has can_admins_bypass: false, or the apply fails.
Actual behavior
The apply reports Modifications complete. GitHub keeps can_admins_bypass: true and updated_at doesn't change. Every later plan shows can_admins_bypass = true -> false again.
Cause
go-github's CreateUpdateEnvironment gets a 422 on these plans. It then retries with only deployment_branch_policy and returns success (google/go-github#4727). The provider can't notice, because resourceGithubRepositoryEnvironmentUpdate (and Create) discard the returned Environment and don't read it back.
Suggestion
Compare the Environment returned by CreateUpdateEnvironment with what was sent, and return an error when can_admins_bypass or prevent_self_review differ. Or read the environment back after a write, so the mismatch surfaces as an inconsistent-result error. Either one turns silent drift into a failed apply. It still matters after google/go-github#4727 is fixed, for any field GitHub accepts and ignores.
Activity
github-actions commentedon Nov 30, 2026
👋 Hi, and thank you for opening this issue!
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 adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues.
🤖 This is an automated message.