indico-plugins/.github/utils/check_version.py
2024-03-30 16:49:29 +01:00

20 lines
537 B
Python

# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2024 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import sys
from configparser import ConfigParser
cp = ConfigParser()
cp.read('_meta/setup.cfg')
version = cp['metadata']['version']
tag_version = sys.argv[1]
if tag_version != version:
print(f'::error::Tag version {tag_version} does not match package version {version}')
sys.exit(1)