Skip to content

telia-oss/githubapp

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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