Skip to content

Conversation

tiulpin
Copy link

@tiulpin tiulpin commented Sep 5, 2025

Resolves #2747


Before the change?

  • Repository and organization ruleset bypass_actors only accepted 4 actor types: RepositoryRole, Team, Integration, OrganizationAdmin
  • Terraform plan would show DeployKey actor types returned by GitHub API, but applying would fail with validation error: expected bypass_actors.1.actor_type to be one of ["RepositoryRole" "Team" "Integration" "OrganizationAdmin"], got DeployKey
  • Provider was not aligned with the complete GitHub REST API specification for repository ruleset bypass actors

After the change?

  • Repository and organization ruleset bypass_actors now accept all 5 officially supported actor types: Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey
  • Actor types are reordered to match the official GitHub API specification
  • Field descriptions updated with official API requirements (e.g., DeployKey should have actor_id set to null)
  • bypass_mode description clarified that pull_request mode is not applicable for DeployKey actor type
  • Terraform configurations with DeployKey bypass actors now apply successfully

Reference: Official GitHub API Schema confirms all 5 actor types in repository-ruleset-bypass-actor enum.

"repository-ruleset-bypass-actor": {
        "title": "Repository Ruleset Bypass Actor",
        "type": "object",
        "description": "An actor that can bypass rules in a ruleset",
        "required": [
          "actor_type"
        ],
        "properties": {
          "actor_id": {
            "type": "integer",
            "nullable": true,
            "description": "The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories."
          },
          "actor_type": {
            "type": "string",
            "enum": [
              "Integration",
              "OrganizationAdmin",
              "RepositoryRole",
              "Team",
              "DeployKey"
            ],
            "description": "The type of actor that can bypass a ruleset."
          },
          "bypass_mode": {
            "type": "string",
            "description": "When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets.",
            "enum": [
              "always",
              "pull_request"
            ],
            "default": "always"
          }
        }
      },

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@kdelorey
Copy link

I think this is a duplicate of #2726 which is an takeover of a stale PR, and I believe there was another ignored attempt prior to that PR too.

The handling of this issue makes me think this project is in need of new maintainers and I suspect just not supported by GitHub anymore.

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.

[BUG]: Error: expected bypass_actors.1.actor_type to be one of ["RepositoryRole" "Team" "Integration" "OrganizationAdmin"], got DeployKey
2 participants