Created
January 14, 2022 08:59
-
-
Save abh006/bade9bfac58f2a01125a1c4ba1997ad5 to your computer and use it in GitHub Desktop.
Get current branch name inside a Github Action
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
... | |
# Add this as a step to the job in which the branch name is needed | |
- name: Set affected branch name | |
id: vars | |
run: echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/*/} | |
... | |
# Use this wherever the branch name is needed | |
${{ steps.vars.outputs.BRANCH_NAME }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment