Skip to content

chore/MSSDK-2108: automated releases github workflows configuration #2

chore/MSSDK-2108: automated releases github workflows configuration

chore/MSSDK-2108: automated releases github workflows configuration #2

name: Pre-release pull request checks
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
defaults:
run:
shell: bash
jobs:
process_release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
packages: write
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check branch name and extract version
id: extract_version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
if ! [[ $BRANCH_NAME =~ ^(release|hotfix)/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "Error: Branch name must be release/x.y.z or hotfix/x.y.z" && exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT