lakruzz / gh-phlow

This repository is a template for our default Github issues developer workflow in Praqma
3 stars 2 forks source link

default_branch doesn't work in private repos #19

Closed lakruzz closed 7 years ago

lakruzz commented 7 years ago

The default_branchalias returns nothing (it fails silently due to -s) when applied to a private repo.

image

The problem is that the github API doesn't authenticate using SSH, but via a token - So we need a token!!! Here's a solution (???)

  1. Go to https://github.com/settings/tokens and generate a new token using the settings: image 2: Capture the token ID right (SHA1) after the creation (is' only showed ONCE) 3 Store it in your git config in the section githubin a key named APIv3 e.g.:
git config --global --add github.APIv3 10ba168ef7bbb2864f3ed4c8ad367892a8252ef3
  1. Update the default_branch alias Line #42 to read:
curl -s -u :`git config --global --get github.APIv3` 'https://api.github.com/repos/'`git hub-name` \

Essentially add the switch

-u :`git config --global --get github.APIv3\`
lakruzz commented 7 years ago

GHI install already sets up a token and install the passphrase in the keychain - So I'm reusing it.