Skip to content

Commit

Permalink
Merge pull request #5 from tj-actions/feature/ensure-the-ref-branch-o…
Browse files Browse the repository at this point in the history
…utput-is-correct
  • Loading branch information
Tonye Jack committed Dec 29, 2020
2 parents 711862b + 6f89b5f commit 8307330
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ on:

## Outputs

| Output | type | Example | Description |
|:--------------------:|:-----------:|:-----------------:|:------------------------------------------------:|
| 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 |
| ref_branch | `string` | `1/merge` | The branch that triggered the workflow run |
| Output | type | Example | Description |
|:--------------------:|:-----------:|:---------------------:|:------------------------------------------------:|
| 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 |
| ref_branch | `string` | `1/merge` | `main` | The branch that triggered the workflow run |



Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ 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\/pull\//}"
REF_BRANCH=${REF/refs\/pull\//}
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
shell: bash
branding:
icon: git-branch
Expand Down

0 comments on commit 8307330

Please sign in to comment.