Training
Module
Leverage GitHub Actions to publish to GitHub Packages - Training
Publish your code libraries or Docker images automatically and securely with GitHub Packages.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When using vcpkg with private registries it is necessary to provide access credentials to authenticate Git operations executed internally by vcpkg.
In this tutorial you will learn how to authenticate a private Git repository to use in your GitHub Actions workflow.
Follow the instructions on GitHub to generate a fine-grained Personal Access Token (PAT) and grant it permission to access the private repository where your vcpkg Git registry is hosted.
Note
Never store a GitHub Personal Access Token in your repository files
The next step is to follow GitHub's instructions to store the PAT as a secret available in your GitHub Actions workflows.
Now is time to add an authentication step to your workflow, use the following template
in your workflow's YAML file. Replace PRIVATE_REPO_URL
with the URL of your private repository,
for example: https://github.com/Microsoft/secret-vcpkg-registry
; replace PRIVATE_REGISTRY_PAT
with the name of the secret variable you created in the previous step.
This workflow step must run before any other workflow step that invokes vcpkg.
- name: Authenticate private registries
shell: bash
run: git config --global credential.PRIVATE_REPO_URL.helper '!f() { echo username=unused; echo password=${{secrets.PRIVATE_REGISTRY_PAT }}; }; f'
The following example shows how to provide Git credentials for multiple private
repositories using the credential.<url>.helper
pattern.
- name: Authenticate private registries
shell: bash
run: |
git config --global credential.https://github.com/vcpkg/private_registry.helper '!f() { echo username=unused; echo password=${{secrets.private_registry_pat}}; }; f'
git config --global credential.https://github.com/vcpkg/secret_registry.helper `!f() { echo username=unused; echo password=${{secrets.secret_registry_pat}}; }; f'
vcpkg feedback
vcpkg is an open source project. Select a link to provide feedback:
Training
Module
Leverage GitHub Actions to publish to GitHub Packages - Training
Publish your code libraries or Docker images automatically and securely with GitHub Packages.