Skip to content

Commit

Permalink
Update publish-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
markbackman authored Nov 26, 2024
1 parent b155b49 commit e21d397
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (must match pyproject.toml)'
description: 'Version to publish (must match pyproject.toml, e.g. 0.0.4)'
required: true
type: string

Expand All @@ -29,7 +29,8 @@ jobs:

- name: Verify version matches
run: |
PROJECT_VERSION=$(python -c "from configparser import ConfigParser; p = ConfigParser(); p.read('pyproject.toml'); print(eval(p['project']['version']))")
pip install tomli
PROJECT_VERSION=$(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$PROJECT_VERSION" != "${{ github.event.inputs.version }}" ]; then
echo "Error: Input version (${{ github.event.inputs.version }}) does not match pyproject.toml version ($PROJECT_VERSION)"
exit 1
Expand Down

0 comments on commit e21d397

Please sign in to comment.