Skip to content

Commit

Permalink
switch to use inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonye Jack committed Dec 11, 2020
1 parent 0da4ec2 commit 4047222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Get branch information without the `/ref/heads` prefix
- uses: actions/checkout@v2
- name: Get branch name
uses: tj-actions/branch-name@v1
id: branch-name
- name: Get brach Names
run: |
echo "${{ steps.branch-name.outputs.base_ref_branch }}"
Expand Down
16 changes: 0 additions & 16 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ inputs:
description: 'GITHUB_TOKEN or a Repo scoped PAT'
required: true
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:
base_ref_branch:
Expand All @@ -30,10 +18,6 @@ outputs:
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.base_ref }}
- ${{ inputs.head_ref }}
- ${{ inputs.ref }}
branding:
icon: git-branch
color: white
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -e

echo "::set-output name=base_ref_branch::${0/refs\/heads\//}"
echo "::set-output name=head_ref_branch::${1/refs\/heads\//}"
echo "::set-output name=ref_branch::${2/refs\/heads\//}"
echo "::set-output name=base_ref_branch::${INPUT_BASE_REF/refs\/heads\//}"
echo "::set-output name=head_ref_branch::${INPUT_HEAD_REF/refs\/heads\//}"
echo "::set-output name=ref_branch::${INPUT_REF/refs\/heads\//}"

0 comments on commit 4047222

Please sign in to comment.