App Installation Repository
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. 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 by the following the instructions at this link.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
// Create a repository.
const someRepo = new github.Repository("some_repo", {name: "some-repo"});
const someAppRepo = new github.AppInstallationRepository("some_app_repo", {
installationId: "1234567",
repository: someRepo.name,
});
Content copied to clipboard
import pulumi
import pulumi_github as github
# Create a repository.
some_repo = github.Repository("some_repo", name="some-repo")
some_app_repo = github.AppInstallationRepository("some_app_repo",
installation_id="1234567",
repository=some_repo.name)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
// Create a repository.
var someRepo = new Github.Repository("some_repo", new()
{
Name = "some-repo",
});
var someAppRepo = new Github.AppInstallationRepository("some_app_repo", new()
{
InstallationId = "1234567",
Repository = someRepo.Name,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a repository.
someRepo, err := github.NewRepository(ctx, "some_repo", &github.RepositoryArgs{
Name: pulumi.String("some-repo"),
})
if err != nil {
return err
}
_, err = github.NewAppInstallationRepository(ctx, "some_app_repo", &github.AppInstallationRepositoryArgs{
InstallationId: pulumi.String("1234567"),
Repository: someRepo.Name,
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.AppInstallationRepository;
import com.pulumi.github.AppInstallationRepositoryArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Create a repository.
var someRepo = new Repository("someRepo", RepositoryArgs.builder()
.name("some-repo")
.build());
var someAppRepo = new AppInstallationRepository("someAppRepo", AppInstallationRepositoryArgs.builder()
.installationId("1234567")
.repository(someRepo.name())
.build());
}
}
Content copied to clipboard
resources:
# Create a repository.
someRepo:
type: github:Repository
name: some_repo
properties:
name: some-repo
someAppRepo:
type: github:AppInstallationRepository
name: some_app_repo
properties:
installationId: '1234567'
repository: ${someRepo.name}
Content copied to clipboard
Import
GitHub App Installation Repository can be imported using an ID made up of installation_id:repository
, e.g.
$ pulumi import github:index/appInstallationRepository:AppInstallationRepository terraform_repo 1234567:terraform
Content copied to clipboard