Add a prefix to all generated environment variables to avoid naming conflicts with GitHub's default environment variables.
steps:
- name: Inject enhanced GitHub environment variables
uses: rlespinasse/github-slug-action@v5
with:
prefix: CI_With this configuration, variables are named CI_GITHUB_REPOSITORY_SLUG, CI_GITHUB_REF_SLUG, CI_GITHUB_SHA_SHORT, etc.
- When a variable name collides with a GitHub default environment variable (the assignment would be silently ignored without a prefix)
- When you want to distinguish slug variables from other environment variables in your workflow
- As a preventive measure against future GitHub environment variable additions
- Inputs reference for the full
prefixinput specification - Troubleshooting for details on variable name collisions