Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes authored Nov 1, 2024
1 parent d3530b7 commit 81b7cf5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ runs:
id: get_version
shell: bash
run: |
if grep -q "LABEL VERSION=" ${{ env.dir }}/Dockerfile; then
# Check for both OCI-compliant version label and generic version label
if grep -q "LABEL org.opencontainers.image.version=" ${{ env.dir }}/Dockerfile; then
version=$(grep "LABEL org.opencontainers.image.version=" ${{ env.dir }}/Dockerfile | cut -d '=' -f 2 | tr -d ' ')
elif grep -q "LABEL VERSION=" ${{ env.dir }}/Dockerfile; then
version=$(grep "LABEL VERSION=" ${{ env.dir }}/Dockerfile | cut -d '=' -f 2 | tr -d ' ')
echo "version=${version}" >> $GITHUB_ENV
else
echo "version=" >> $GITHUB_ENV
version=""
fi
echo "version=${version}" >> $GITHUB_ENV
# Always create a short SHA for tagging
short_sha=$(echo "${{ github.sha }}" | cut -c1-7)
Expand Down

0 comments on commit 81b7cf5

Please sign in to comment.