You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: github_app_installation_repositories allows modifying app for another org #2431
When setting the owner argument for the provider, a github_app_installation_repositories resource should only be allowed to modify app installations for the target Github org
Actual Behavior
When you are using a token that has access to multiple organizations and those organizations have repositories with the same name. You can modify the app installation in one org when targeting the other (repo steps below)
Terraform Version
Terraform v1.9.8
on darwin_arm64
Affected Resource(s)
github_app_installation_repositories
Terraform Configuration Files
No response
Steps to Reproduce
Create a Github PAT for a user that has access to multiple organizations
Create a repository in both organizations with the same name
Add a Github app to both organizations with the created repository as the only selected app
In terraform, set the owner argument to one of the organizations
Add a github_app_installation_repositories resource that references the app id of the other organization and remove all selected repos
Apply the change
The outcome will be that the selected repo was removed from the other organization instead of the organization specified in the owner argument of the provider
Where this is really a problem is if you have an app installation in one org with say 10 selected repos. You then create a new github_app_installation_repositories resource for the other org (and forget to update the app installation id in the resource) and set the selected repos to just one (one with same name as a repo in the other org). When you apply, the app installation with 10 selected repos, will now only have the one selected repo
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
Activity
a88zach commentedon Oct 18, 2024
Where this is really a problem is if you have an app installation in one org with say 10 selected repos. You then create a new github_app_installation_repositories resource for the other org (and forget to update the app installation id in the resource) and set the selected repos to just one (one with same name as a repo in the other org). When you apply, the app installation with 10 selected repos, will now only have the one selected repo
github-actions commentedon Jul 23, 2025
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!