Skip to content

[BUG]: github_app_installation_repositories allows modifying app for another org #2431

Closed as not planned

Description

@a88zach

Expected Behavior

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

Debug Output

No response

Panic Output

No response

Code of Conduct

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

Activity

  1. added
    Status: Triage
    Type: Bug
    on Oct 18, 2024
  2. a88zach commented on Oct 18, 2024

    @a88zach
    Author

    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

  3. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Oct 25, 2024
  4. added
    Status: Up for grabs
    and removed
    Status: Triage
    on Oct 25, 2024
  5. github-actions commented on Jul 23, 2025

    @github-actions

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

  6. added
    Status: Stale
    on Jul 23, 2025
  7. moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Activeon Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleStatus: Up for grabsType: Bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions