Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added organization role support #2487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevehipwell
Copy link
Contributor

@stevehipwell stevehipwell commented Nov 29, 2024

Resolves #2314
Resolves #2224


Before the change?

  • No support for organization org roles

After the change?

  • Added support for organization or roles
  • Data sources
    • github_organization_repository_role
    • github_organization_repository_roles
    • github_organization_role
    • github_organization_role_teams
    • github_organization_users
    • github_organization_roles
    • github_organization_security_managers
  • Resources
    • github_organization_repository_role
    • github_organization_role
    • github_organization_role_team
    • github_organization_role_user

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

@stevehipwell stevehipwell force-pushed the organization-roles branch 3 times, most recently from 78ab564 to 468dc74 Compare December 2, 2024 13:01
@stevehipwell stevehipwell force-pushed the organization-roles branch 2 times, most recently from ff32898 to be0f2aa Compare December 9, 2024 11:19
@stevehipwell stevehipwell marked this pull request as ready for review December 9, 2024 11:20
@stevehipwell stevehipwell force-pushed the organization-roles branch 3 times, most recently from b04dee2 to bc23c8e Compare December 12, 2024 17:20
@jtnz
Copy link

jtnz commented Jan 30, 2025

JFYI I think that this will conflict with github_repository_collaborators and will need a note in the docs to warn users.

I tried this out today (manually assigned an org role to a team) and on the next TF apply run it proceeded to spend the next ~45mins trying to remove the team from every repo in the organization. It finished happily (and with no actual affect), but the next run it does the same thing. I believe the problem is in the GH API. It mashes all team access together and offers no way to differentiate why the teams are in the list ("direct access" vs "organization access").

@stevehipwell
Copy link
Contributor Author

@jtnz github_repository_collaborators has an input to allow it to not conflict with organization roles; the docs likely should belong on github_repository_collaborators (check out #2551 where these are already being updated). This is a GitHub issue and not provider related, due to the way the API works there isn't an easy way to filter org role users out at the repo level.

@jtnz
Copy link

jtnz commented Feb 6, 2025

@stevehipwell Haha, yeah, I just found this in 6.5.0. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants