Fix grep for version number in docker build (#15699)

Grep now only returns _first_ result and "version" has to be at start of
line.
This commit is contained in:
Dylan 2025-01-23 13:14:58 -06:00 committed by GitHub
parent b5ffb404de
commit 90589372da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ jobs:
env: env:
TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag || 'dry-run' }} TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag || 'dry-run' }}
run: | run: |
version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g') version=$(grep -m 1 "^version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
if [ "${TAG}" != "${version}" ]; then if [ "${TAG}" != "${version}" ]; then
echo "The input tag does not match the version from pyproject.toml:" >&2 echo "The input tag does not match the version from pyproject.toml:" >&2
echo "${TAG}" >&2 echo "${TAG}" >&2