Storing Credentials in GitHub¶
How to securely store your Core App credentials for use in GitHub Actions workflows.
Repository Secrets¶
For single-repository usage:
- Navigate to repository Settings
- Go to Secrets and variables → Actions
- Click New repository secret
- Add two secrets:
CORE_APP_ID: Numeric app IDCORE_APP_PRIVATE_KEY: Complete.pemfile contents
Organization Secrets¶
For organization-wide usage (recommended):
- Navigate to Organization Settings
- Go to Secrets and variables → Actions
- Click New organization secret
- Add secrets with same names as above
- Configure Repository access:
- All repositories - Available to all org repos
- Selected repositories - Choose specific repos
Advantage
Single source of truth, centralized rotation.
Secret Naming Conventions¶
| Secret Name | Contents | Example |
|---|---|---|
CORE_APP_ID |
Numeric app ID | 123456 |
CORE_APP_PRIVATE_KEY |
Complete PEM file contents | -----BEGIN RSA PRIVATE KEY-----... |
Best Practices¶
Repository vs Organization Secrets¶
| Aspect | Repository Secrets | Organization Secrets |
|---|---|---|
| Scope | Single repository | Multiple repositories |
| Management | Per-repo updates | Centralized updates |
| Rotation | Update each repo | Update once |
| Access Control | Repository admins | Organization admins |
Recommendation
Use organization secrets for Core Apps to simplify rotation and management.
Secret Access Control¶
For organization secrets, consider:
- All repositories - When app needs org-wide access
- Selected repositories - When limiting to specific workflows
- Private repositories only - Additional security layer
Workflow Access¶
Reference secrets in workflows:
- name: Generate token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CORE_APP_ID }}
private-key: ${{ secrets.CORE_APP_PRIVATE_KEY }}
Environment Protection¶
For additional security, use GitHub Environments:
- Create an environment (e.g.,
production) - Add secrets to the environment
- Configure protection rules:
- Required reviewers
- Wait timer
- Deployment branches
jobs:
deploy:
environment: production
steps:
- name: Generate token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CORE_APP_ID }}
private-key: ${{ secrets.CORE_APP_PRIVATE_KEY }}