Skip to content

Commit

Permalink
6.4.5-rc2 (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu authored Oct 14, 2024
2 parents 231d709 + df7bf7b commit 085f90d
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/pr-semver-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,44 @@ on:
- beta
- stable

workflow_dispatch:
inputs:
pr_number:
description: "Pull request number to check"
required: true
type: number

jobs:
check-pr-semver-title:
runs-on: ubuntu-latest
name: Validate PR Title

steps:
- name: Get PR details
id: find_pr
run: |
if [ -z "${{ github.event.inputs.pr_number }}" ]; then
prNumber=${{ github.event.pull_request.number }}
else
prNumber=${{ github.event.inputs.pr_number }}
fi
echo "prNumber=$prNumber" | tee /dev/stderr >> "$GITHUB_OUTPUT"
- name: Fetch pull request title
id: pr_title
uses: actions/github-script@v7
with:
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
const prNumber = ${{ steps.find_pr.outputs.prNumber }};
const { data: pull_request } = await github.rest.pulls.get({
owner: owner,
repo: repo,
pull_number: prNumber
});
return pull_request.title;
- name: Check PR title format
run: |
version="${{ github.event.pull_request.title }}"
version="${{ steps.pr_title.outputs.result }}"
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
Expand Down

0 comments on commit 085f90d

Please sign in to comment.