Created
February 25, 2020 13:13
-
-
Save keithrozario/e079be6bc68456bd9c6da50a567e5c4c to your computer and use it in GitHub Desktop.
Getting the Branch Name from GitHub actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- uses: actions/checkout@v1 | |
- name: Set Branch name to $STAGE env var | |
run: | | |
BRANCH="$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" | |
echo "BRANCH is $BRANCH" | |
echo "::set-env name=STAGE::$BRANCH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment