Hotfix v0.2088.1 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |