Skip to content

chore: Update valid permissions for organization repository role#3444

Open
w1mvy wants to merge 2 commits into
integrations:mainfrom
w1mvy:update-organization-repository-role-permissions
Open

chore: Update valid permissions for organization repository role#3444
w1mvy wants to merge 2 commits into
integrations:mainfrom
w1mvy:update-organization-repository-role-permissions

Conversation

@w1mvy

@w1mvy w1mvy commented May 25, 2026

Copy link
Copy Markdown

Before the change?

  • validRolePermissions in github/resource_github_organization_repository_role.go was a snapshot of the GitHub repository fine-grained permissions API and had drifted from the upstream response. It rejected newer permissions (read_copilot_agent_settings, write_copilot_agent_settings, write_repository_agent_secrets, write_repository_agent_variables) at plan time via CustomizeDiff, even though the GitHub API would accept them.
  • The doc-link comment above the slice referenced apiVersion=2022-11-28, which is no longer the current version on the linked GitHub docs page.

After the change?

  • The four permissions above are added to validRolePermissions (kept alphabetically sorted) so configurations using them now pass validation.
  • The doc-link comment is bumped to apiVersion=2026-03-10 to match the current GitHub docs page for GET /orgs/{org}/repository-fine-grained-permissions.
  • The list was generated by calling GET /orgs/{org}/repository-fine-grained-permissions against a real org and diffing the returned names against the existing slice; only additions were observed (no permissions removed upstream).

Pull request checklist

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

Notes:

  • make generatedocs produced no diff (the generated docs do not enumerate individual permissions).
  • make fmt, make lint, and make test all pass locally.

Does this introduce a breaking change?

  • Yes
  • No

@github-actions

Copy link
Copy Markdown

👋 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! 🚀

@w1mvy w1mvy marked this pull request as ready for review May 25, 2026 08:11
}

// Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization
// Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2026-03-10#list-repository-fine-grained-permissions-for-an-organization

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Please don't change the API version, since the SDK hasn't upgraded API Version yet either.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, fixed in this commit 2331a87


// Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization
// Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2026-03-10#list-repository-fine-grained-permissions-for-an-organization
// The endpoint isn't covered in the SDK yet.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deiga deiga added this to the v6.14.0 milestone Jul 14, 2026

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deiga I think we were planning on revisiting this once I got the endpoint added to go-github. We could generate the data, but it would still need a release to keep it up to date. How about we look at adding a singleton pattern to make it available in the provider?

@w1mvy w1mvy requested a review from deiga July 14, 2026 12:25
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.

3 participants