Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
zap

GitHub Action

Setup Variables

v1.0.1

Setup Variables

zap

Setup Variables

Map your variables based on other keys

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Variables

uses: simenandre/[email protected]

Learn more about this action in simenandre/setup-variables

Choose a version

setup variables variable mapper github actions

Map variable with ease

uses: cobraz/setup-variables@v1
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.