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: allow users to set GitHub app in their repositories #2469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions github/resource_github_app_installation_repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ func resourceGithubAppInstallationRepositoriesDelete(d *schema.ResourceData, met
}

func getAllAccessibleRepos(meta interface{}, idString string) (map[string]int64, int64, error) {
err := checkOrganization(meta)
if err != nil {
return nil, 0, err
}

installationID, err := strconv.ParseInt(idString, 10, 64)
if err != nil {
return nil, 0, unconvertibleIdErr(idString, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestAccGithubAppInstallationRepositories(t *testing.T) {
})

t.Run("with an individual account", func(t *testing.T) {
t.Skip("individual account not supported for this operation")
testCase(t, individual)
})

t.Run("with an organization account", func(t *testing.T) {
Expand Down
15 changes: 0 additions & 15 deletions github/resource_github_app_installation_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ func resourceGithubAppInstallationRepository() *schema.Resource {
}

func resourceGithubAppInstallationRepositoryCreate(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

installationIDString := d.Get("installation_id").(string)
installationID, err := strconv.ParseInt(installationIDString, 10, 64)
if err != nil {
Expand All @@ -71,11 +66,6 @@ func resourceGithubAppInstallationRepositoryCreate(d *schema.ResourceData, meta
}

func resourceGithubAppInstallationRepositoryRead(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
installationIDString, repoName, err := parseTwoPartID(d.Id(), "installation_id", "repository")
if err != nil {
Expand Down Expand Up @@ -124,11 +114,6 @@ func resourceGithubAppInstallationRepositoryRead(d *schema.ResourceData, meta in
}

func resourceGithubAppInstallationRepositoryDelete(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

installationIDString := d.Get("installation_id").(string)
installationID, err := strconv.ParseInt(installationIDString, 10, 64)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_app_installation_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestAccGithubAppInstallationRepository(t *testing.T) {
})

t.Run("with an individual account", func(t *testing.T) {
t.Skip("individual account not supported for this operation")
testCase(t, individual)
})

t.Run("with an organization account", func(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/app_installation_repositories.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ description: |-
~> **Note**: This resource is not compatible with the GitHub App Installation authentication method.

This resource manages relationships between app installations and repositories
in your GitHub organization.
in your GitHub organization or your user account.

Creating this resource installs a particular app on multiple repositories.

The app installation and the repositories must all belong to the same
organization on GitHub. Note: you can review your organization's installations
organization or user account on GitHub. Note: you can review your organization's installations
by the following the instructions at this
[link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations).
[link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations) or for your user account at this [link](https://docs.github.com/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps).

## Example Usage

Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/app_installation_repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ description: |-
~> **Note**: This resource is not compatible with the GitHub App Installation authentication method.

This resource manages relationships between app installations and repositories
in your GitHub organization.
in your GitHub organization or your user account.

Creating this resource installs a particular app on a particular repository.

The app installation and the repository must both belong to the same
organization on GitHub. Note: you can review your organization's installations
organization or user account on GitHub. Note: you can review your organization's installations
by the following the instructions at this
[link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations).
[link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations) or for your user account at this [link](https://docs.github.com/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps).

## Example Usage

Expand Down