Updated to use a composite action

This commit is contained in:
Tonye Jack 2020-12-11 08:41:21 -05:00
parent 6f69b01735
commit c05e12be63
3 changed files with 11 additions and 22 deletions

View File

@ -1,9 +0,0 @@
FROM alpine:3.12
LABEL maintainer="Tonye Jack <jtonye@ymail.com>"
RUN apk add bash
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -21,19 +21,24 @@ inputs:
outputs:
base_ref_branch:
value: ${{ steps.branch.outputs.base_ref_branch }}
description: 'The target branch of a pull request'
head_ref_branch:
value: ${{ steps.branch.outputs.head_ref_branch }}
description: 'The source branch of a pull request'
ref_branch:
value: ${{ steps.branch.outputs.ref_branch }}
description: 'The branch that triggered the workflow run.'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.base_ref }}
- ${{ inputs.head_ref }}
- ${{ inputs.ref }}
using: "composite"
steps:
- id: branch
run: |
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\//}"
shell: bash
branding:
icon: git-branch
color: white

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
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\//}"