Skip to content

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.0with:
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.0with:
token: ${{ secrets.GH_AUTH_TOKEN }}# orpersist-credentials: false

About

Authenticate with GitHub using a OAuth2 token when installing private packages

Resources

Stars

1 star

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages