#!/bin/sh # version_env.sh: Reads the version from the Dockerfile and sets MAJOR, MAJOR_MINOR, VERSION as environment variables VERSION=$(grep 'org.opencontainers.image.version' Dockerfile | cut -d'=' -f2 | tr -d '"') MAJOR=$(echo "$VERSION" | cut -d. -f1) MAJOR_MINOR=$(echo "$VERSION" | awk -F. '{print $1 "." $2}') echo "VERSION=$VERSION" >> $GITHUB_ENV echo "MAJOR=$MAJOR" >> $GITHUB_ENV echo "MAJOR_MINOR=$MAJOR_MINOR" >> $GITHUB_ENV