From 4047222df10c4bf99ea98f2521d07fb236e402d7 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 11 Dec 2020 08:32:12 -0500 Subject: [PATCH] switch to use inputs. --- README.md | 1 + action.yml | 16 ---------------- entrypoint.sh | 6 +++--- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 71a7ffc..f1f97df 100644 --- a/README.md +++ b/README.md @@ -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 }}" diff --git a/action.yml b/action.yml index 078d026..93d2e2e 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 0ff7b61..8784ced 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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\//}"