Using private packages / dependencies
How to use Github packages for private dependencies
Accessing GitHub packages for private dependencies requires the following steps:
Create a personal access token in GitHub
Open your Codemagic app settings, and go to the Environment variables tab.
Enter the desired Variable name, e.g.
GITHUB_TOKEN
.Copy and paste the token as Variable value.
Enter the variable group name, e.g. github_credentials. Click the button to create the group.
Make sure the Secure option is selected.
Click the Add button to add the variable.
Add the variable group to your
codemagic.yaml
fileenvironment: groups: - github_credentials
Create a .npmrc file with the following contents (where @owner is your github username):
registry=https://registry.npmjs.org/ @owner:registry=https://npm.pkg.github.com/ //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}