Skip to content

nomadops/go-github-apps-helpers

go-github-apps-helpers

go-github-apps-helpers is a Go package that provides a library of useful functions for interacting with the GitHub API as a GitHub App.

Installation

To install the go-github-apps-helpers package, run the following command:

go get -u github.com/nomadops/go-github-apps-helpers

To use the RemoveRepoFromInstallation function, import the installations package and call the function with the following arguments:

package main

import (
    "context"
    "github.com/bradleyfalzon/ghinstallation"
    "github.com/nomadops/go-github-apps-helpers/installations"
)

func main() {
    // Set up the GitHub App installation transport using the app ID, installation ID, and private key
    appID := 12345
    installationID := 67890
    privateKeyPath := "path/to/private/key.pem"
    itr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, appID, installationID, privateKeyPath)
    if err != nil {
        panic(err)
    }

    // Remove the repository with the given ID from the GitHub App installation with the given IDs
    repoID := 1234567890
    err = installations.RemoveRepoFromInstallation(context.Background(), appID, installationID, repoID, itr)
    if err != nil {
        panic(err)
    }
}

installations

import "github.com/nomadops/go-github-apps-helpers"

Index

func RemoveRepoFromInstallation

func RemoveRepoFromInstallation(ctx context.Context, appID int64, installationID int64, repoID int64, itr *ghinstallation.Transport) error

RemoveRepoFromInstallation removes a GitHub repository from a GitHub App installation.

LICENSE

This project is licensed under the MIT License.

About

Helper functions for working with GitHub Apps and App Installations.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages