Merge pull request #1 from tj-actions/feature/test

This commit is contained in:
Tonye Jack 2020-12-11 09:14:40 -05:00 committed by GitHub
commit 325ee91404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -10,11 +10,19 @@ Get branch information without the `/ref/heads` prefix
- name: Get branch name
uses: tj-actions/branch-name@v1
id: branch-name
- name: Get brach Names
- name: Get Ref brach name
run: |
echo "${{ steps.branch-name.outputs.ref_branch }}" # Outputs: "main"
- name: Get Head Ref branch name
if: github.event_name == 'pull_request'
run: |
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
- name: Get Base Ref branch name
if: github.event_name == 'pull_request'
run: |
echo "${{ steps.branch-name.outputs.base_ref_branch }}"
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
echo "${{ steps.branch-name.outputs.ref_branch }}"
```

View File

@ -40,7 +40,7 @@ runs:
export REF=${{ inputs.ref }}
echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
echo "::set-output name=ref_branch::${REF/refs\/heads\//}"
echo "::set-output name=ref_branch::${REF/refs\/pull\//}"
shell: bash
branding:
icon: git-branch