Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Get the list of branches and which of them is the default

License

Notifications You must be signed in to change notification settings

3ShapeInternal/get-default-branch

 
 

Repository files navigation

get-default-branch

Get the default branch or an empty string, if there are no branches in the repository. You can call the action in your workflow like this:

    - name: Get default branch name
      id: defaultBranchName
      uses: MindaugasLaganeckas/get-default-branch@v1
      with:
        token: ${{ secrets.SUPER_SECRET }}
        path: ${{ env.OWNER }}/${{ env.REPO }}

You can access the output like this:

    - name: Change to master branch if repository is empty
      if: ${{ steps.defaultBranchName.outputs.default-branch == '' }}

About

Get the list of branches and which of them is the default

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%