Skip to content

telia-oss/githubapp

Repository files navigation

githubapp

go.dev reference latest release build status code quality

A small Go package for handling authentication with a Github App using owner login and repository names instead of UUIDs. Installations and repositories are cached internally and refreshed (lazily) on a set interval, to reduce the number of List* API calls against the Apps API.

Usage

package main

import (
	"github.com/telia-oss/githubapp"

	"github.com/google/go-github/v45/github"
)

func main() {
    client, err := githubapp.NewClient(911, []byte("private-key"))
    if err != nil {
        panic(err)
    }

    app := githubapp.New(client)

    token, err := app.CreateInstallationToken(
        "telia-oss",
        []string{"githubapp"},
		&githubapp.Permissions{
            Metadata: github.String("read"),
        },
    )
    if err != nil {
        panic(err)
    }
}

About

Small package for handling Github App authentication

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages