Skip to content
name: Check version updated
on:
pull_request:
branches:
- 'main'
paths:
- 'src/*'
jobs:
getCandidateVersion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.abapVersion.outputs.version }}
steps:
- name: Get current repository version value
uses: RegestaItalia/abapVersion@main
id: abapVersion
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: development
getLatestVersion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.latestRelease.outputs.release }}
steps:
- name: Get latest release
id: latestRelease
uses: pozetroninc/github-action-get-latest-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
excludes: prerelease, draft
compareVersions:
runs-on: ubuntu-latest
needs: [ getCandidateVersion, getLatestVersion ]
steps:
- uses: madhead/semver-utils@latest
id: compareSemver
with:
version: ${{ needs.getCandidateVersion.outputs.version }}
compare-to: ${{ needs.getLatestVersion.outputs.version }}
- if: steps.compareSemver.outputs.comparison-result != '>'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Version should be increased in order to merge create a new release.')