Skip to content
git-branch

GitHub Action

Get branch name

v1.0.1 Latest version

Get branch name

git-branch

Get branch name

Export branch name as environment variable

Installation

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

              

- name: Get branch name

uses: nelonoel/[email protected]

Learn more about this action in nelonoel/branch-name

Choose a version

Use branch name on GitHub actions

Convenience action for using current branch name.

Usage

name: build
on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - run: npm ci
    - uses: nelonoel/branch-name@v1
    # Use branch name for whatever purpose
    - run: echo ${BRANCH_NAME}