Skip to content

[BUG]: Resource github_repository_ruleset doesn't delete bypass_actors on GitHub #2179

Closed

Description

@ViacheslavKudinov

Expected Behavior

Bypass actors are deleted on the Rule when Terraform code doesn't contain it anymore

Actual Behavior

Bypass actors are still present on the Rule when Terraform code doesn't contain it anymore

Terraform Version

Terraform v1.7.4
on darwin_arm64

  • provider registry.terraform.io/integrations/github v5.45.0
    same on v6.0.1

Affected Resource(s)

  • github_repository_ruleset

Terraform Configuration Files

resource "github_repository_ruleset" "rule_01" {
  name        = "Usual branch protection"
  repository  = SOME_REPO
  target      = "branch"
  enforcement = "active"

  conditions {
    ref_name {
      include = ["~ALL"]
      exclude = []
    }
  }
  # bypass_actors {
  #   actor_id    = github_team.SOME_TEAM.id
  #   actor_type  = "Team"
  #   bypass_mode = "pull_request"
  # }
  rules {
    pull_request {
      dismiss_stale_reviews_on_push     = false
      require_code_owner_review         = true
      require_last_push_approval        = false
      required_approving_review_count   = 1
      required_review_thread_resolution = false
    }
  }
}

Steps to Reproduce

Uncomment bypass_actors,
run
terraform apply
check GitHub UI,
comment bypass_actors again,
run
terraform apply
check output

  ~ resource "github_repository_ruleset" "rule_01" {
        id          = "CENSORED"
        name        = "Usual branch protection"
        # (6 unchanged attributes hidden)

      - bypass_actors {
          - actor_id    = CENSORED -> null
          - actor_type  = "Team" -> null
          - bypass_mode = "pull_request" -> null
        }

        # (2 unchanged blocks hidden)
    }

check UI,
Bypass actor setting is still here
Screenshot 2024-03-04 at 6 22 26 PM

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Status: Triage
    Type: Bug
    on Mar 4, 2024
  2. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Mar 4, 2024
  3. added
    Status: Up for grabs
    and removed
    Status: Triage
    on Mar 4, 2024
  4. changed the title [-][BUG]: Resource `github_repository_ruleset` doesn't delete `bypass_actors` on GitHub[/-] [+][BUG]: Resource `github_repository_ruleset` doesn't delete `bypass_actors` on GitHub (v5.45.0 and v6.0.1 are affected)[/+] on Mar 7, 2024
  5. changed the title [-][BUG]: Resource `github_repository_ruleset` doesn't delete `bypass_actors` on GitHub (v5.45.0 and v6.0.1 are affected)[/-] [+][BUG]: Resource `github_repository_ruleset` doesn't delete `bypass_actors` on GitHub[/+] on Mar 13, 2024
  6. github-actions commented on Dec 9, 2024

    @github-actions

    👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

  7. added
    Status: Stale
    on Dec 9, 2024
  8. audunsolemdal commented on Dec 9, 2024

    @audunsolemdal

    Please pin this issue as this bug is still super annoying

  9. ViacheslavKudinov commented on Dec 9, 2024

    @ViacheslavKudinov
    ContributorAuthor

    Hi,
    yes, it is still here.
    We can't remove this bypass settings as code, but only via UI, which is not how it has to work.

  10. removed
    Status: Stale
    on Dec 10, 2024
  11. github-actions commented on Sep 7, 2025

    @github-actions

    👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

  12. 3 remaining items

  13. added 2 commits that reference this issue on Oct 17, 2025
    6d16e7b
    fde811e
  14. moved this from Backlog to On Deck in Terraform Provideron Oct 21, 2025
  15. moved this from On Deck to In Progress in Terraform Provideron Oct 21, 2025
  16. moved this from In Progress to In Review in Terraform Provideron Oct 21, 2025
  17. added a commit that references this issue on Oct 21, 2025
    1d3427e
  18. audunsolemdal commented on Nov 13, 2025

    @audunsolemdal

    Finally works after the 6.8.0 release, thanks!

    Just noticed that the same inablity to delete bypass_actors is still true for the github_organization_ruleset resource

  19. moved this from Done to In Progress in Terraform Provideron Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsType: Bug

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions