This is an action that dynamically outputs the default branch from the remote origin of a public repository.
By default, it outputs the default branch from the remote origin of the current
repository.
The owner/repo pair of the target repository.
Default: ${{ github.repository }}
The name of the default branch of the target repository e.g. 'main', 'release' etc.
- this way the action would output the default branch of the current repository from its origin remote:
- name: Get default branch from origin
id: get-origin-default-branch
uses: pipeline-foundation/get-origin-def-branch@v1.0.0
- this way the action would output the default branch of a user-defined repository from its origin remote
- name: Get default branch from origin of owner/repo
id: get-origin-default-branch
uses: pipeline-foundation/get-origin-def-branch@v1.0.0
with:
origin: owner/repo
- to consume the output, use the following reference:
${{ steps.get-origin-default-branch.outputs.default_branch }}
- example:
- run: |
echo "The default branch of this repository is ${{ steps.get-origin-default-branch.outputs.default_branch }}"
Thank you for considering a contribution! Please check out our detailed contribution guide to learn more about how to help us improve the project.