Update README.md

This commit is contained in:
Tonye Jack 2021-04-24 06:41:16 -04:00 committed by GitHub
parent dcd6890824
commit 15b5e1609f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ Get branch information without the `/ref/*` prefix
| 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` *OR* `main` | The branch that triggered the workflow run | | ref_branch | `string` | `1/merge` *OR* `main` | The branch that triggered the workflow run |
| tag | `string` | `v0.0.1` *OR* `0.0.1` | The tag that triggered the workflow run |
## Usage ## Usage
@ -77,7 +78,12 @@ Get branch information without the `/ref/*` prefix
run: | run: |
echo "${{ steps.branch-name.outputs.base_ref_branch }}" echo "${{ steps.branch-name.outputs.base_ref_branch }}"
# Outputs: "main" for main <- PR branch. # Outputs: "main" for main <- PR branch.
- name: Get the current tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "${{ steps.branch-name.outputs.tag }}"
# Outputs: "v0.0.1" OR "0.0.1"
``` ```