Skip to content

feat: add data sources for listing GitHub App installations in an organization#2573

Open
atilsensalduz wants to merge 6 commits intointegrations:mainfrom
atilsensalduz:main
Open

feat: add data sources for listing GitHub App installations in an organization#2573
atilsensalduz wants to merge 6 commits intointegrations:mainfrom
atilsensalduz:main

Conversation

@atilsensalduz
Copy link

@atilsensalduz atilsensalduz commented Feb 23, 2025

This PR introduces a new data source, github_app_installations, to enable listing all installed GitHub Apps within an organization. This addition enhances integration with existing resources such as github_app_installation_repository, providing better automation and management capabilities for GitHub App permissions.

What's New?
New Data Source: github_app_installations
Allows fetching all installed GitHub Apps in an organization:

data "github_organization_app_installations" "all_apps" {}

Example Use Case:
This data source can be integrated with the github_app_installation_repository resource to manage app permissions on specific repositories:

# Local value to find the correct app installation by slug
locals {
  # Find the index of the desired app by its slug
  app_index = index(
    data.github_organization_app_installations.all_apps.installations[*].slug,
    "desired-app-name"  # Replace with your actual app slug
  )
  
  # Get the app_id using the found index
  app_installation_id = data.github_organization_app_installations.all_apps.installations[local.app_index].id
}

# Link the repository to the app installation
resource "github_app_installation_repository" "some_app_repo" {
  installation_id = local.app_installation_id
  repository     = github_repository.some_repo.name
}

API Reference: https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization

Related Issue: #2570

@atilsensalduz atilsensalduz changed the title feat: Add data sources for listing GitHub App installations in an organization feat: add data sources for listing GitHub App installations in an organization Feb 23, 2025
@nickfloyd nickfloyd moved this from 🆕 Triage to 👀 In review in 🧰 Octokit Active Feb 27, 2025
@github-actions
Copy link

github-actions bot commented Dec 6, 2025

👋 Hey Friends, this pull request 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!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Dec 6, 2025
Copy link
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

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

Hey 👋

Thank you for your contribution!

I've requested a few changes to make this fit into the provider even better :)

@github-project-automation github-project-automation bot moved this from 👀 In review to 🏗 In progress in 🧰 Octokit Active Dec 10, 2025
@deiga
Copy link
Collaborator

deiga commented Jan 15, 2026

@atilsensalduz Please rebase and go through the comments

@atilsensalduz
Copy link
Author

@atilsensalduz Please rebase and go through the comments

Hey @deiga , apologies for the late reply. I somehow missed this PR. Thanks so much for the review! I’ve worked through your suggestions.

@atilsensalduz
Copy link
Author

Hi @deiga , I've changed the PR according to your suggestions. Could you please take a look again when you have time? Thanks in advance.

@atilsensalduz atilsensalduz requested a review from deiga January 16, 2026 11:41
@atilsensalduz atilsensalduz requested a review from deiga January 16, 2026 13:37
@stevehipwell stevehipwell added this to the v6.11.0 Release milestone Jan 16, 2026
@stevehipwell stevehipwell added Type: Feature New feature or request New data source and removed Status: Stale Used by stalebot to clean house labels Jan 16, 2026
diofeher
diofeher previously approved these changes Jan 16, 2026
@stevehipwell
Copy link
Collaborator

@atilsensalduz could you please rebase this PR?

Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @atilsensalduz, I've added a couple of comments. Could you also add support for single_file_paths, created_at & updated_at.

atilsensalduz and others added 5 commits January 30, 2026 22:56
…pp_installations data source

Signed-off-by: atilsensalduz <atil.sensalduz@gmail.com>
Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com>
Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com>
Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com>
…pp_installations data source

Signed-off-by: atilsensalduz <atil.sensalduz@gmail.com>
@stevehipwell
Copy link
Collaborator

@atilsensalduz this is looking good. Have you run the test locally, if so could you please attach a screenshot of the output?

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

Labels

New data source Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants