Skip to content

pocke/gha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GHA

GitHub Authentication.

Installation

go get github.com/pocke/gha

Usage

Basic usage

import "github.com/pocke/gha"

func main() {
  key, err := gha.Auth("pocke", "PASSWORD", gha.Request{
    Note: "gist-app",
    Scopes: []string{"gist"},
  })
  if err != nil {
    panic(err)
  }
  fmt.Println(key)    # => Psersonal access token of GitHub
}

For CLI Application

main.go

import "github.com/pocke/gha"

func main() {
  key, err := gha.CLI("key.txt", gha.Request{
    Note: "hoge-app",
  })
  if err != nil {
    panic(err)
  }
  fmt.Println(key)
}

Run

$ go run main.go
username: <INPUT YOUR USER NAME>
password for <YOUR USER NAME> (never stored): <INPUT YOUR PASSWORD>
<SHOW YOUR KEY>

gha.CLI saves your key to file. If key is saved already, gha.CLI returns saved key.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages