Skip to content

[FEAT]: Support RepositoryMigration actor type in bypass_actors for ruleset #3336

Open

Description

@AnBorodin

Describe the need

The current implementation of bypass_actors in github_repository_ruleset and github_organization_ruleset resources does not support RepositoryMigration as a valid actor_type, causing the following error when applying Terraform configurations that include it:

expected actor_type to be one of ["Integration" "OrganizationAdmin" "RepositoryRole" "Team" "DeployKey"], got RepositoryMigration

This is needed when migrating repositories that already have rulesets configured - the RepositoryMigration actor type allows bypassing ruleset rules during migration, preventing failures when importing repositories with existing branch protection or ruleset configurations.

SDK Version

No response

API Version

No response

Relevant log output

Error: expected actor_type to be one of ["Integration" "OrganizationAdmin" "RepositoryRole" "Team" "DeployKey"], got RepositoryMigration

Code of Conduct

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

Activity

  1. added
    Type: Feature
    Status: Triage
    on Apr 15, 2026
  2. github-actions commented on Apr 15, 2026

    @github-actions

    👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

  3. ThomasMasak commented on Jul 23, 2026

    @ThomasMasak

    Actually, 'User' actor_type also seems to be unsupported, even though the docs state it should be:

    tfplan error:

    │ Error: expected actor_type to be one of ["RepositoryRole" "Team" "Integration" "OrganizationAdmin" "DeployKey"], got User
    │ 
    │   with module.repositories.github_repository_ruleset.main["some_repo"],
    │   on ../../modules/repositories/main.tf line 89, in resource "github_repository_ruleset" "main":
    │   89: resource "github_repository_ruleset" "main" {

    Docs description:

    actor_type (String) The type of actor that can bypass a ruleset. Can be one of: RepositoryRole, Team, Integration, OrganizationAdmin, DeployKey, EnterpriseOwner, User.

  4. deiga commented on Jul 23, 2026

    @deiga
    Collaborator

    @ThomasMasak are you certain you're on the latest provider version and getting that error?

    If yes, could you please open a Bug and fill out the template so that we can figure out what's wrong?

  5. ThomasMasak commented on Jul 24, 2026

    @ThomasMasak

    @ThomasMasak are you certain you're on the latest provider version and getting that error?

    If yes, could you please open a Bug and fill out the template so that we can figure out what's wrong?

    @deiga
    Ahh, this is embarrassing. Yup we were still on v6.12.1. I just checked the releases and it has been added in v6.13.0.
    Our Dependabot runs monthly so it was just missed by a couple of days it seems.
    My apologies.

  6. cfarrend commented on Aug 31, 2026

    @cfarrend

    Hi @deiga, we are using v6.13.0 and still are facing this issue. (@ThomasMasak did you resolve it?)

    If adding manually and re-running Terraform we get something that looks like this (we have two exceptions)

      # github_organization_ruleset.protect_default_branch will be updated in-place
      ~ resource "github_organization_ruleset" "protect_default_branch" {
            id          = "20260243"
            name        = "Protect default branch"
            # (5 unchanged attributes hidden)
    
          ~ bypass_actors {
              ~ actor_id    = 0 -> ***
              ~ actor_type  = "RepositoryMigration" -> "Integration"
              ~ bypass_mode = "exempt" -> "always"
            }
    
            # (2 unchanged blocks hidden)
        }

    And on apply when setting

    bypass_actors {
        actor_type = "RepositoryMigration"
        bypass_mode = "exempt"
      }

    We get the error

    ╷
    │ Error: expected actor_type to be one of ["Integration" "OrganizationAdmin" "RepositoryRole" "Team" "DeployKey" "EnterpriseOwner"], got RepositoryMigration
    │
    │   with github_organization_ruleset.protect_default_branch,
    │   on rulesets.tf line 22, in resource "github_organization_ruleset" "protect_default_branch":
    │   22:     actor_type = "RepositoryMigration"
    │
    Error: Process completed with exit code 1.
    

    Happy to raise another ticket

  7. deiga commented on Aug 31, 2026

    @deiga
    Collaborator

    @cfarrend This hasn't been resolved,
    AFAIK there isn't even a PR yet

  8. cfarrend commented on Aug 31, 2026

    @cfarrend

    Thanks @deiga

    I saw this PR here but I think it was done before the changes released #3337

    Happy to look into it

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: TriageType: Featurer/repository_ruleset

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions