Skip to content

A small Golang utility to clone a GitHub repository using Github app credentials.

License

Notifications You must be signed in to change notification settings

nwaringa/tokenclone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tokenclone

Octocatopher

A small Golang utility to clone a GitHub repository using Github app credentials.

Where is this helpful?

You can use this in a bunch of ways. One example of a use for this is Ansible Tower which currently is limited to using PATs for its Github integration. PATs and things like service account users both overscope access as well as allow long aged tokens, by using this utility you can avoid that.

Requirements

You need to have a Github App built and deployed to the repos you want to clone. Do that first.

Build

  • Clone repo
  • Build the binary
    • Defaults to an osx build
    • OS X build option make compile-osx
    • Linux arm build option make compile-linux
    • Windows build option make compile-windows
  • Your binary to run is in bin/

Usage

Warning: Your App ID is semi-sensitive information and your key (.pem file) is private and is definately sensitive. If you build this into a workflow, be sure to pickup these details in a secure manner.

Linux/OS X:
./tokenclone --app_id <id> --pem_path <path to your pem> --repo_url <git repo, https clone link>, and --clone_dir <directory to clone to>

Windows:
tokenclone.exe --app_id <id> --pem_path <path to your pem> --repo_url <git repo, https clone link>, and --clone_dir <directory to clone to>

Help

./tokenclone --help

About

A small Golang utility to clone a GitHub repository using Github app credentials.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published