Skip to content

Commit 503b187

Browse files
authored
Fix toml and tag comparison.
Signed-off-by: Caroline Russell <[email protected]>
1 parent 0d6ef9f commit 503b187

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,18 @@ jobs:
7474
if: startsWith(github.ref, 'refs/tags/')
7575
run: |
7676
poetry install --no-cache --without dev
77-
toml_version=$(poetry version -s)
77+
toml_version=$(echo "v"$(poetry version -s))
7878
if [[ $toml_version != $(echo $GITHUB_REF | cut -d / -f 3) ]]; then
79-
echo "VERSION_MATCH="failure"" >> $GITHUB_ENV
80-
else
81-
echo "VERSION_MATCH="success"" >> $GITHUB_ENV
79+
echo "TOML version does not match tag."
80+
exit 1
8281
fi
8382
8483
- name: Build dist
85-
if: ${{ env.VERSION_MATCH == 'success' }}
84+
if: startsWith(github.ref, 'refs/tags/')
8685
run: |
8786
poetry build --no-cache
8887
8988
- name: Release PyPI
90-
if: ${{ env.VERSION_MATCH == 'success' }}
89+
if: startsWith(github.ref, 'refs/tags/')
9190
uses: pypa/gh-action-pypi-publish@release/v1
9291

0 commit comments

Comments
 (0)