Skip to content

Hotfix v0.2066.1

Hotfix v0.2066.1 #5

name: "🔒 Protect Release Branches"
on:
pull_request:
branches:
- release/*
types:
- opened
- reopened
- synchronize
jobs:
protect-release-branches:
name: "Protect Release Branches"
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Check if tag already exists
id: check_tag
run: |
branch_name=${{ github.event.pull_request.base.ref }}
version=${branch_name#"release/"}
git fetch --tags
echo "Checking if tag ${version} already exists..."
if [[ -n $(git tag -l "${version}") ]]; then
echo "Release tag ${version} already exists, thus this branch cannot be changed."
exit 1;
fi
if [[ -n $(git tag -l "${version}-rc.*") ]]; then
echo "Release candidate tag ${version}-rc.* already exists, thus this branch cannot be changed."
exit 1;
fi