Skip to content

Commit

Permalink
Add new github workflow to check for semvers in beta/stable PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Oct 14, 2024
1 parent 15f7635 commit ccf1f04
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pr-semver-title.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ccf1f04

Please sign in to comment.