-
-
Notifications
You must be signed in to change notification settings - Fork 6
Using a Personal Access Token to grant access to private dependencies
Personal Access Tokens are a simpler option for granting access to a private dependency.
(Prefer a more robust and flexible solution? Check out a different method using SSH Keypairs)
There are three steps:
- Create a Personal Access Token
- Add your PAT to your project's Secrets
- Update the Workflow file
On GitHub, go to your account settings: At the bottom of the menu, go to "Developer Settings", then "Personal access tokens":
"Generate New Token":
For your token's name, try to name it something that you'll remember grants GLuaTest access to your dependency.
As for the expiration date, it's better if you select a definite expiration date, but it'll be fine if you set it to unlimited. In our opinion, the best solution is to choose an expiration date that's 1-3 years away.
Click the "repo" checkbox to give this token access to private repositories that you have access to.
Then, generate the token.
Once it's generated, be sure to copy the token (you can only see it once!).
Go to Your Projects repository settings, then navigate to Secrets -> Actions:
New repository secret:
Be sure to name it something that reminds you it's for GLuaTest. Paste your Personal Access Token into the Value
input, then click "Add secret"
You need to share your Personal Access Token with GLuaTest.
Add the github-token:
key to the with
block of your GLuaTest step:
name: GLuaTest Runner
on:
pull_request:
jobs:
run-tests:
uses: CFC-Servers/GLuaTest/.github/workflows/run_tests.yml@main
with:
github-token: "${{ secrets.GLUATEST_TOKEN }}"
All done! When GLuaTest runs, it will be able to clone your project's private dependencies.