To use a specific API key in your GitHub Actions workflow, you can store it as a Repository Secret and reference it using the secrets context in your YAML file. This ensures the key is encrypted and masked in your workflow logs. 1. Store the API Key as a Secret Navigate to your repository on GitHub.com. Click Settings > Secrets and variables > Actions. Select the Secrets tab and click New repository secret. In the Name field, enter a descriptive identifier (e.g., MY_API_KEY). Rules: Use only alphanumeric characters or underscores; cannot start with a number or GITHUB_. In the Secret field, paste your API key value and click Add secret. 2. Reference the Secret in your YAML File In your .github/workflows/your-workflow.yml file, access the secret using the syntax ${{ secrets.NAME_OF_SECRET }}. It is a best practice to map it to an environment variable within a specific step rather than echoing it directly. Example Workflow in yaml: name: Use API Key Example on: [push] jobs: my-job: runs-on: ubuntu-latest steps: - name: Run script with API Key # Map the secret to an environment variable for the runner env: API_KEY: ${{ secrets.MY_API_KEY }} run: | # Use the environment variable in your commands curl -H "Authorization: Bearer $API_KEY" https://api.example.com Reference: https://docs.github.com/actions/security-guides/using-secrets-in-github-actions