mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-23 20:53:50 +08:00
switch to use inputs.
This commit is contained in:
parent
0da4ec27fc
commit
4047222df1
@ -9,6 +9,7 @@ Get branch information without the `/ref/heads` prefix
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Get branch name
|
- name: Get branch name
|
||||||
uses: tj-actions/branch-name@v1
|
uses: tj-actions/branch-name@v1
|
||||||
|
id: branch-name
|
||||||
- name: Get brach Names
|
- name: Get brach Names
|
||||||
run: |
|
run: |
|
||||||
echo "${{ steps.branch-name.outputs.base_ref_branch }}"
|
echo "${{ steps.branch-name.outputs.base_ref_branch }}"
|
||||||
|
16
action.yml
16
action.yml
@ -6,18 +6,6 @@ inputs:
|
|||||||
description: 'GITHUB_TOKEN or a Repo scoped PAT'
|
description: 'GITHUB_TOKEN or a Repo scoped PAT'
|
||||||
required: true
|
required: true
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
base_ref:
|
|
||||||
description: 'The target branch of a pull request'
|
|
||||||
default: ${{ github.base_ref }}
|
|
||||||
required: false
|
|
||||||
head_ref:
|
|
||||||
description: 'The source branch of a pull request'
|
|
||||||
default: ${{ github.head_ref }}
|
|
||||||
required: false
|
|
||||||
ref:
|
|
||||||
description: 'The branch that triggered the workflow run.'
|
|
||||||
default: ${{ github.ref }}
|
|
||||||
required: false
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
base_ref_branch:
|
base_ref_branch:
|
||||||
@ -30,10 +18,6 @@ outputs:
|
|||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
args:
|
|
||||||
- ${{ inputs.base_ref }}
|
|
||||||
- ${{ inputs.head_ref }}
|
|
||||||
- ${{ inputs.ref }}
|
|
||||||
branding:
|
branding:
|
||||||
icon: git-branch
|
icon: git-branch
|
||||||
color: white
|
color: white
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "::set-output name=base_ref_branch::${0/refs\/heads\//}"
|
echo "::set-output name=base_ref_branch::${INPUT_BASE_REF/refs\/heads\//}"
|
||||||
echo "::set-output name=head_ref_branch::${1/refs\/heads\//}"
|
echo "::set-output name=head_ref_branch::${INPUT_HEAD_REF/refs\/heads\//}"
|
||||||
echo "::set-output name=ref_branch::${2/refs\/heads\//}"
|
echo "::set-output name=ref_branch::${INPUT_REF/refs\/heads\//}"
|
||||||
|
Loading…
Reference in New Issue
Block a user