Installing in CI
Install private Packs in GitHub Actions, GitLab CI or any other pipeline.
Use a Team Token in CI. It belongs to the Team, not a person, so pipelines keep working when someone leaves. Store it as a secret named POLYPACK_TOKEN. To install, it needs only read. To publish from GitHub Actions, use trusted publishing instead of a Token with publish; in other pipelines, give the Team Token publish.
Composer
- run: composer install --no-interaction --prefer-dist
env:
COMPOSER_AUTH: '{"http-basic": {"hopper.pkg.polypack.io": {"username": "token", "password": "${{ secrets.POLYPACK_TOKEN }}"}}}'
install:
image: composer:2
script:
- export COMPOSER_AUTH="{\"http-basic\": {\"hopper.pkg.polypack.io\": {\"username\": \"token\", \"password\": \"${POLYPACK_TOKEN}\"}}}"
- composer install --no-interaction --prefer-dist
export COMPOSER_AUTH="{\"http-basic\": {\"hopper.pkg.polypack.io\": {\"username\": \"token\", \"password\": \"${POLYPACK_TOKEN}\"}}}"
composer install --no-interaction --prefer-dist
npm
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: lts/*
registry-url: https://hopper.pkg.polypack.io/npm/
scope: '@hopper'
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.POLYPACK_TOKEN }}
install:
image: node:lts
script:
- npm config set //hopper.pkg.polypack.io/npm/:_authToken "${POLYPACK_TOKEN}"
- npm ci
npm config set //hopper.pkg.polypack.io/npm/:_authToken "$POLYPACK_TOKEN"
npm ci
Each Pack's page in PolyPack shows these lines for that Pack under CI.
Update bots: Renovate and Dependabot
Renovate and Dependabot need the same read-only Team Token to see new versions of your private Packs; without it they skip them, often without saying so. Store it as the bot's own secret POLYPACK_TOKEN, never in the file. Both read the npm scope from your project's committed .npmrc and the Composer repository from composer.json, which the install setup puts there. Keep only the registries you use.
{
"hostRules": [
{
"matchHost": "https://hopper.pkg.polypack.io/npm/",
"hostType": "npm",
"token": "{{ secrets.POLYPACK_TOKEN }}"
},
{
"matchHost": "hopper.pkg.polypack.io",
"hostType": "packagist",
"username": "token",
"password": "{{ secrets.POLYPACK_TOKEN }}"
},
{
"matchHost": "https://hopper.pkg.polypack.io/rubygems/",
"hostType": "rubygems",
"username": "token",
"password": "{{ secrets.POLYPACK_TOKEN }}"
},
{
"matchHost": "hopper.cr.polypack.io",
"hostType": "docker",
"username": "token",
"password": "{{ secrets.POLYPACK_TOKEN }}"
}
]
}
version: 2
registries:
polypack-npm:
type: npm-registry
url: https://hopper.pkg.polypack.io/npm/
token: ${{secrets.POLYPACK_TOKEN}}
polypack-composer:
type: composer-repository
url: https://hopper.pkg.polypack.io/composer
username: token
password: ${{secrets.POLYPACK_TOKEN}}
polypack-bundler:
type: rubygems-server
url: https://hopper.pkg.polypack.io/rubygems/
token: ${{secrets.POLYPACK_TOKEN}}
polypack-docker:
type: docker-registry
url: https://hopper.cr.polypack.io
username: token
password: ${{secrets.POLYPACK_TOKEN}}
updates:
- package-ecosystem: npm
directory: "/"
registries: [polypack-npm]
schedule:
interval: weekly
- package-ecosystem: composer
directory: "/"
registries: [polypack-composer]
schedule:
interval: weekly
- package-ecosystem: bundler
directory: "/"
registries: [polypack-bundler]
schedule:
interval: weekly
- package-ecosystem: docker
directory: "/"
registries: [polypack-docker]
schedule:
interval: weekly
A private Pack's page shows these under Update bots, and a Client's setup instructions include them for its Client Token.
To publish npm packages or push images from GitHub Actions, you need no stored Token at all: PolyPack's GitHub Action does it in one step, with trusted publishing.