diff --git a/.github/workflows/pr-semver-title.yml b/.github/workflows/pr-semver-title.yml new file mode 100644 index 000000000..55a600c77 --- /dev/null +++ b/.github/workflows/pr-semver-title.yml @@ -0,0 +1,23 @@ +name: Check PR title for proper semver + +on: + pull_request: + branches: + - beta + - stable + +jobs: + check-pr-semver-title: + runs-on: ubuntu-latest + name: Validate PR Title + + steps: + - name: Check PR title format + run: | + version="${{ github.event.pull_request.title }}" + if ! [[ "$version" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then + echo "Invalid semver: '$version'!" + exit 1 + fi + echo "Version is proper semver: $version" +