Skip to content

Commit 0d8b6ca

Browse files
authored
gh-actions/github/checkout: Add branch name output (#907)
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent 19f2ebd commit 0d8b6ca

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

gh-actions/github/checkout/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ inputs:
1313
committer-email:
1414
type: string
1515
default:
16+
strip-prefix:
17+
type: string
18+
default:
1619

1720
outputs:
1821
token:
1922
value: ${{ steps.appauth.outputs.token }}
23+
branch_name:
24+
value: ${{ steps.branch.outputs.name }}
2025

2126

2227
runs:
@@ -54,3 +59,10 @@ runs:
5459
COMMITTER_NAME: ${{ inputs.committer-name }}
5560
COMMITTER_EMAIL: ${{ inputs.committer-email }}
5661
shell: bash
62+
- run: |
63+
REF_NAME="$(git rev-parse --abbrev-ref HEAD)"
64+
BRANCHNAME="${REF_NAME#${{ inputs.strip-prefix }}}"
65+
echo "name=${BRANCHNAME}" >> $GITHUB_OUTPUT
66+
name: Get branch name
67+
id: branch
68+
shell: bash

0 commit comments

Comments
 (0)