Skip to content

⚡️ Map variables on Github Actions runs based on input

License

Notifications You must be signed in to change notification settings

simenandre/setup-variables

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

setup variables variable mapper github actions

Map variable with ease

uses: simenandre/setup-variables@v2
id: stack
with:
  key: ${{ env.CI_REF_NAME_SLUG }}
  map: |
    main: prod
    staging: staging
    dev: dev
    '*': dev

How does this compare to X?

There are multiple other Github Actions step that tries to solve similar/same issues.

variable-mapper for instance, has mostly the same functionality as this. The schema design is mostly the same, only difference being that the original uses JSON for mapping.