Adding secrets to GitHub Actions
Solution
- Navigate to https://github.com/OWNER/REPO/settings/secrets/actions
- Add a Repository secret
- That's it! It can now be used in GitHub Actions
# .github/workflows/using-secrets.yml
name: Example on using secrets
on:
workflow_dispatch:
jobs:
example:
runs-on: ubuntu-latest
steps:
- run: yarn directus-to-data --collection-output src/_data/{{collectionName}}.json -c CollectionName
env:
CMS_URL: ${{ secrets.CMS_URL }}
STATIC_TOKEN: ${{ secrets.STATIC_TOKEN }}