1
0
mirror of https://github.com/mveril/qp-demo synced 2024-07-22 10:47:34 +02:00

Fix branch name extraction

This commit is contained in:
Mickaël Véril 2021-06-14 13:20:55 +02:00
parent fbaa052489
commit 562ac3226a

View File

@ -25,14 +25,19 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Get Docker tag from branch name
id: extract_docker_tag
shell: bash
run: |
if [ "${{ GITHUB_REF#refs/heads/ }}" == "master" ]; then
if [ "${{ steps.extract_branch.outputs.branch }}" == "master" ]; then
echo "##[set-output name=tag;]$(echo 'latest')"
elif [[ "${{ GITHUB_REF#refs/heads/ }}" == release_* ]]; then
echo "##[set-output name=tag;]$(echo '${{ GITHUB_REF#refs/heads/ }}' | cut -d '_' -f2-)"
elif [[ "${{ steps.extract_branch.outputs.branch }}" == release_* ]]; then
echo "##[set-output name=tag;]$(echo '${GITHUB_REF#refs/heads/}' | cut -d '_' -f2-)"
else
echo "##[set-output name=tag;]$(echo 'ghtest')"
fi