-
Notifications
You must be signed in to change notification settings - Fork 905
feat: add data sources for listing GitHub App installations in an organization #2573
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
base: main
Are you sure you want to change the base?
Conversation
…tion This commit introduces a new data source, 'github_organization_app_installations', to enable listing all installed GitHub Apps within an organization. References: - API Documentation: https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization - Related Issue: integrations#2570 Signed-off-by: atilsensalduz <[email protected]>
…tion This commit introduces a new data source, 'github_organization_app_installations', to enable listing all installed GitHub Apps within an organization. References: - API Documentation: https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization - Related Issue: integrations#2570 Signed-off-by: atilsensalduz <[email protected]>
|
👋 Hey Friends, this pull request has been automatically marked as |
deiga
left a comment
There was a problem hiding this 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 :)
| return &schema.Resource{ | ||
| Read: dataSourceGithubOrganizationAppInstallationsRead, | ||
|
|
||
| Schema: map[string]*schema.Schema{ | ||
| "installations": { | ||
| Type: schema.TypeList, | ||
| Computed: true, | ||
| Elem: &schema.Resource{ | ||
| Schema: map[string]*schema.Schema{ | ||
| "id": { | ||
| Type: schema.TypeInt, | ||
| Computed: true, | ||
| }, | ||
| "slug": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| }, | ||
| "app_id": { | ||
| Type: schema.TypeInt, | ||
| Computed: true, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Could you please add Description fields to the Schema and all fields?
|
|
||
| func dataSourceGithubOrganizationAppInstallations() *schema.Resource { | ||
| return &schema.Resource{ | ||
| Read: dataSourceGithubOrganizationAppInstallationsRead, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Could you refactor this to use ReadContext?
| import ( | ||
| "context" | ||
|
|
||
| "github.com/google/go-github/v66/github" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I doubt we'll be able to land this before #2602
Maybe you could even rebase on top of that branch?
| "github.com/google/go-github/v66/github" | |
| "github.com/google/go-github/v77/github" |
| "app_id": { | ||
| Type: schema.TypeInt, | ||
| Computed: true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Could you add the following fields to this:
- repository_selection
- permissions
- events
- html_url
- client_id
- target_id
- target_type
- suspended
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:
API Reference: https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization
Related Issue: #2570