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:
|
outputs:
|
||||||
base_ref_branch:
|
base_ref_branch:
|
||||||
|
value: ${{ steps.branch.outputs.base_ref_branch }}
|
||||||
description: 'The target branch of a pull request'
|
description: 'The target branch of a pull request'
|
||||||
head_ref_branch:
|
head_ref_branch:
|
||||||
|
value: ${{ steps.branch.outputs.head_ref_branch }}
|
||||||
description: 'The source branch of a pull request'
|
description: 'The source branch of a pull request'
|
||||||
ref_branch:
|
ref_branch:
|
||||||
|
value: ${{ steps.branch.outputs.ref_branch }}
|
||||||
description: 'The branch that triggered the workflow run.'
|
description: 'The branch that triggered the workflow run.'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: "composite"
|
||||||
image: 'Dockerfile'
|
steps:
|
||||||
args:
|
- id: branch
|
||||||
- ${{ inputs.base_ref }}
|
run: |
|
||||||
- ${{ inputs.head_ref }}
|
echo "::set-output name=base_ref_branch::${INPUT_BASE_REF/refs\/heads\//}"
|
||||||
- ${{ inputs.ref }}
|
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:
|
branding:
|
||||||
icon: git-branch
|
icon: git-branch
|
||||||
color: white
|
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…
x
Reference in New Issue
Block a user