Skip to content
battery

GitHub Action

Branch mapper

v2.0.1 Latest version

Branch mapper

battery

Branch mapper

Maps branch name to corresponding environment name

Installation

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

              

- name: Branch mapper

uses: AlexRogalskiy/[email protected]

Learn more about this action in AlexRogalskiy/github-action-branch-mapper

Choose a version

GitHub branch mapper

GitHub tag (latest by date) GitHub Release Date Lines of code GitHub closed issues GitHub closed pull requests GitHub repo size GitHub last commit GitHub GitHub language count GitHub search hit counter GitHub Repository branches GitHub Repository dependents Dependabot NewReleases Hits-of-Code ComVer Public workflows that use this action. Licence

Parses branch name and optionally maps to environment name

- uses: alexrogalskiy/github-actions/github-action-branch-mapper@master
  with:
    github-ref: ${{ github.ref }}
    map: ${{ toJSON({ dev: 'staging', production: 'production', '.*': 'sandbox' })  }}

Outputs:

  • environment - environment name

Run locally:

  • yarn run_action --action github-ref-to-env --github-ref refs/heads/my/branch-name --map '{ "dev": "staging", ".*": "sandbox" }'