mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-12-27 14:27:59 +08:00
Updated to use a composite action
This commit is contained in:
parent
6f69b01735
commit
c05e12be63
@ -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"]
|
17
action.yml
17
action.yml
@ -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
|
||||
|
@ -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\//}"
|
Loading…
Reference in New Issue
Block a user