Skip to content

Make action use environment based on branch name #56123

Discussion options

You must be logged in to vote

This is Bash syntax, which isn't available outside run steps using Bash as the shell.

    environment:
      name: ${GITHUB_REF##*/}

You need to use Actions syntax instead. It looks like github.ref_name should be what you need:

    environment:
      name: ${{ github.ref_name }}

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@DutchJelly
Comment options

Answer selected by DutchJelly
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
5 participants