mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-23 18:43:51 +08:00
Update README.md
This commit is contained in:
parent
6d21079679
commit
71ea4d1bd6
@ -12,17 +12,20 @@ Get branch information without the `/ref/*` prefix
|
||||
id: branch-names
|
||||
- name: Get Ref brach name
|
||||
run: |
|
||||
echo "${{ steps.branch-name.outputs.ref_branch }}" # Outputs: "main" for non PR branches | "1/merge" for a PR branch
|
||||
echo "${{ steps.branch-name.outputs.ref_branch }}"
|
||||
# Outputs: "main" for non PR branches | "1/merge" for a PR branch
|
||||
|
||||
- name: Get Head Ref branch name
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
echo "${{ steps.branch-name.outputs.head_ref_branch }}" # Outputs: "feature/test" current PR branch.
|
||||
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
|
||||
# Outputs: "feature/test" current PR branch.
|
||||
|
||||
- name: Get Base Ref branch name
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
echo "${{ steps.branch-name.outputs.base_ref_branch }}" # Outputs: "main" for main <- PR branch.
|
||||
echo "${{ steps.branch-name.outputs.base_ref_branch }}"
|
||||
# Outputs: "main" for main <- PR branch.
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user