API Keys in CI
GitHub Actions
Add NativeLink Cloud to a GitHub Actions Workflow
To run NativeLink cloud in your workflow, you will need to create a YAML in
your .github/workflows
folder with the following added to your jobs
section:
Configure Secrets in your GitHub Repository
GitHub Repository Secrets is the recommended way to store your NativeLink Cloud API keys for use with GitHub Actions.
The GitHub repository secrets tutorial will show you how to setup a repository secret. You can then access those variables from the secrets context in your GitHub actions:
Repositories that use forks
If your repository is open source and uses forks for pull requests (PRs), the secrets and vars context aren’t accessible in the actions for PRs originating from the forks. To address this, we recommend using Read-Only keys.
These keys can be generated in the Settings > API Keys & Certs
sections of the cloud dashboard.
Read-Only keys can be used for PRs and be hard-coded into your GitHub actions. For merge-to-main actions, use a Read/Write key stored in the secrets context. An example of this below:
Read Only keys
For Read Only API Keys you need to set these two flags:
BEP Disabled Keys
For keys where BEP is disabled, remove the following flags from your Config:
Third-Party Secrets Management
If you need info on setting up API keys for different CI environments, ask in the Slack channel or open an issue on our GitHub.