Feat extend identification configuration #33
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: Check version | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
check-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
id: version | |
run: | | |
case "${{ github.base_ref }}" in | |
main) | |
echo "version=$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
;; | |
develop) | |
echo "version=$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)-rc" >> $GITHUB_OUTPUT | |
;; | |
*) | |
echo "version=${{ github.base_ref }}" >> $GITHUB_OUTPUT | |
;; | |
esac | |
- name: Print version | |
run: echo ${{ steps.version.outputs.version }} | |
- name: Find git tag | |
if: ${{ github.base_ref == 'main' || github.base_ref == 'develop' }} | |
uses: mukunku/[email protected] | |
id: check-tag-exists | |
with: | |
tag: ${{ steps.version.outputs.version }} | |
- name: Tag verification | |
if: ${{ github.base_ref == 'main' || github.base_ref == 'develop' }} | |
id: check-tag | |
run: | | |
if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then | |
echo "Tag ${{ steps.version.outputs.version }} already exists, don't forget to upgrade your pom" | |
exit 1 | |
fi |