Merge pull request #5 from tj-actions/feature/ensure-the-ref-branch-output-is-correct

This commit is contained in:
Tonye Jack 2020-12-29 09:16:54 -05:00 committed by GitHub
commit 8307330ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -61,11 +61,11 @@ on:
## Outputs ## Outputs
| Output | type | Example | Description | | Output | type | Example | Description |
|:--------------------:|:-----------:|:-----------------:|:------------------------------------------------:| |:--------------------:|:-----------:|:---------------------:|:------------------------------------------------:|
| base_ref_branch | `string` | `main` | The target branch of a pull request | | base_ref_branch | `string` | `main` | The target branch of a pull request |
| head_ref_branch | `string` | `feature/test` | The source branch of a pull request | | head_ref_branch | `string` | `feature/test` | The source branch of a pull request |
| ref_branch | `string` | `1/merge` | The branch that triggered the workflow run | | ref_branch | `string` | `1/merge` | `main` | The branch that triggered the workflow run |

View File

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