Skip to content

Authenticate with GitHub using a OAuth2 token when installing private packages

License

Notifications You must be signed in to change notification settings

onomondo/github-auth-javascript-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Auth action

This action uses a GitHub OAuth2 token to resolve private repository urls without putting secrets in local files.

In all aspects this action is heavily inspired by timshadel/heroku-buildpack-github-netrc and The Vanilla DevOps Git Credentials & Private Packages Cheatsheet.

Requirements

You can create your secret by going to settings -> secrets and then adding GH_AUTH_TOKEN with the Oauth2 token (personal access token).

Example usage

uses: onomondo/github-auth-javascript-action@v1.0.0
with:
  github-auth-token: ${{ secrets.GH_AUTH_TOKEN }}

Caveats

If you're using actions/checkout@v2 or higher you need to do one of the following:

  • Set token: ${{ secrets.GH_AUTH_TOKEN }}
  • Set persist-credentials: false
uses: actions/checkout@v2.1.0
with:
  token: ${{ secrets.GH_AUTH_TOKEN }}
  # or
  persist-credentials: false

About

Authenticate with GitHub using a OAuth2 token when installing private packages

Resources

License

Stars

Watchers

Forks

Packages

No packages published