Skip to content

Commit

Permalink
Do not fail version check if development version is set
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdguy committed Nov 15, 2023
1 parent 2dd47db commit 31eb105
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,26 @@ jobs:
- name: NEWS.md and DESCRIPTION Version check 🏁
run: |
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
NEWS_VERSION=$(awk '/^#+ /{print $3; exit}' NEWS.md)
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md)
DESC_DEV_VERSION=$(echo $DESC_VERSION | awk -F '.' '{print $NF}')
echo "NEWS.md version: $NEWS_VERSION"
echo "DESCRIPTION version: $DESC_VERSION"
if (test $DESC_VERSION = $NEWS_VERSION ); then
echo "NEWS.md and DESCRIPTION have the same version"
else
echo "🙈 NEWS.md and DESCRIPTION have different versions!"
echo "🙏 Please fix this."
exit 1
if [[ "$DESC_VERSION" == "$NEWS_VERSION" ]]
then {
echo "NEWS.md and DESCRIPTION have the same version 🎉"
exit 0
}
fi
if [[ $DESC_DEV_VERSION -gt 9000 && "$NEWS_VERSION" == "(development version)" ]]
then {
echo "NEWS.md and DESCRIPTION file versions are okay as package is in development mode."
echo "All is okay 🆗"
exit 0
}
fi
echo "🙈 NEWS.md and DESCRIPTION have different versions!"
echo "🙏 Please fix this."
exit 1
shell: bash
working-directory: ${{ inputs.package-subdirectory }}

Expand Down

0 comments on commit 31eb105

Please sign in to comment.