Skip to content

Commit fc4ba6b

Browse files
committed
🦺 compare package version with ref/tag before publishing to PyPI
1 parent 35f98a6 commit fc4ba6b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ jobs:
1919
id-token: write
2020
steps:
2121
- uses: actions/checkout@v3
22+
- name: Compare package version with ref/tag
23+
id: compare
24+
run: |
25+
set -e
26+
VERSION=$(awk -F'"' '/__version__/ {print $2}' mysql-to-sqlite3/__version__.py)
27+
TAG=${GITHUB_REF_NAME#v}
28+
if [[ "$VERSION" != "$TAG" ]]; then
29+
echo "Version in mysql-to-sqlite3/__version__.py ($VERSION) does not match tag ($TAG)"
30+
exit 1
31+
fi
2232
- name: Set up Python
2333
uses: actions/setup-python@v4
2434
with:

0 commit comments

Comments
 (0)