Staging #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: version-check | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
version-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Retrieve version from __version__.py | |
run: | | |
VERSION=$(awk -F"'" '/__version__/{print $2}' sequence/__version__.py) | |
- name: Retrieve version from CHANGELOG.md | |
run: | | |
CHANGELOG_VERSION=$(awk 'match($0, /\[[0-9]+\.[0-9]+\.[0-9]+\]/) {print substr($0, RSTART+1, RLENGTH-2); exit}' CHANGELOG.md) | |
- name: Compare the two version | |
run: | | |
if [ "$VERSION" != "$CHANGELOG_VERSION" ]; then | |
echo "The project version doesn't match the one of the CHANGELOG" | |
exit 1 | |
fi | |
echo "The project version and the CHANGELOG version match" |