Skip to content

Instantly share code, notes, and snippets.

@keithrozario
Created February 25, 2020 13:13
Show Gist options
  • Save keithrozario/e079be6bc68456bd9c6da50a567e5c4c to your computer and use it in GitHub Desktop.
Save keithrozario/e079be6bc68456bd9c6da50a567e5c4c to your computer and use it in GitHub Desktop.
Getting the Branch Name from GitHub actions
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