Skip to content

[BUG]: github_organization_role base_role effectively can't be set to none #2960

Closed

Description

@jmeickle-theaiinstitute

Expected Behavior

github_organization_role contains both org-scoped and repo-scoped permissions. A base role is only required if setting repo-scoped permissions; and is not desirable in orgs where the base repository role for the org is set to "None".

However, the module doesn't seem to support either omitting this argument, or setting it to none.

Additionally, ignore_changes on base_role doesn't help because other changes to the resource will still attempt to set this on a PATCH and trigger the below error messages.

Actual Behavior

I can't omit the base_role argument or explicitly null it:

│ Error: error updating GitHub custom organization role ([REDACTED]): PATCH https://api.github.com/orgs/[REDACTED]: 422 Invalid request.
│ 
│ Invalid property /base_role: `` is not a possible value. Must be one of the following: none, read, triage, write, maintain, admin. []
│ 
│   with github_organization_role.base,
│   on roles.tf line 4, in resource "github_organization_role" "base":
│    4: resource "github_organization_role" "base" {
│ 
╵

But I also can't set it to none:

╷
│ Error: Error
│ 
│   with github_organization_role.base,
│   on roles.tf line 14, in resource "github_organization_role" "base":
│   14:   base_role = "none"
│ 
│ none is an invalid value for argument [{{} base_role}]

Or set it to an empty string:

╷
│ Error: Error
│ 
│   with github_organization_role.base,
│   on roles.tf line 14, in resource "github_organization_role" "base":
│   14:   base_role = ""
│ 
│  is an invalid value for argument [{{} base_role}]
╵

Terraform Version

Terraform v1.13.5
on linux_amd64
+ provider registry.terraform.io/integrations/github v6.8.3

Your version of Terraform is out of date! The latest version
is 1.14.0. You can update by downloading from https://developer.hashicorp.com/terraform/install

Affected Resource(s)

  • github_organization_role

Terraform Configuration Files

resource "github_organization_role" "base" {
  name        = "Organization base permissions"

  base_role = "none"
  permissions = [
    "edit_org_custom_properties_values",
    "read_custom_properties_for_organizations",
  ]
  lifecycle {
      ignore_changes = [base_role]
  }
}

Steps to Reproduce

No response

Debug Output

Panic Output

Code of Conduct

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

Activity

  1. added
    Type: Bug
    Status: Triage
    on Dec 3, 2025
  2. deiga commented on Dec 3, 2025

    @deiga
    Collaborator

    Hey @jmeickle-theaiinstitute

    Thanks for raising this! You are right that this behaviour isn't working correctly.

    Would you be interested in submitting a PR to address this?

  3. jmeickle-theaiinstitute commented on Dec 4, 2025

    @jmeickle-theaiinstitute
    Author

    I don't anticipate working on this as I just worked around it for the time being.

  4. deiga commented on Dec 4, 2025

    @deiga
    Collaborator

    Fair enough! We're focusing on getting the new v7 release out.
    After that's done we can start addressing more of the bug reports ☺️

  5. self-assigned this
    on Dec 4, 2025
  6. removed
    Type: Bug
    on Dec 4, 2025
  7. added
    Type: Bug
    and removed
    Status: Triage
    on Dec 4, 2025
  8. stevehipwell commented on Dec 4, 2025

    @stevehipwell
    Collaborator

    I'll pick this up, it looks like the API changed between the PR for this being created and merged (a year), and the docs don't really help.

  9. hoexter commented on Dec 16, 2025

    @hoexter

    @stevehipwell @nickfloyd Setting base_role = "none" or base_role = null now causes a permanent diff setting it to base_role = "none". What now works is the workaround of ignoring the change via lifecycle {}. Tested with v6.9.0.
    Not sure if you'd prefer reopening that one or creating a new issue?

  10. stevehipwell commented on Dec 16, 2025

    @stevehipwell
    Collaborator

    @hoexter could you please open a new issue with a bit more detail about your configuration and the churn you're seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions