Skip to content

Commit

Permalink
extract branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Oct 11, 2023
1 parent 8e6fc5a commit 8e023b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ jobs:
IMAGE_ID=$(echo ghcr.io/${{ github.repository }} | tr '[A-Z]' '[a-z]')
echo ::set-output name=IMAGE_ID::$IMAGE_ID
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Get the version
id: get_version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${{ steps.extract_branch.outputs.branch }}"
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
echo ::set-output name=VERSION::$VERSION
Expand Down

0 comments on commit 8e023b5

Please sign in to comment.