Update branch name check to allow docs branch merge to main

This commit is contained in:
Luqman
2024-03-14 15:08:27 +01:00
parent 313e3bfa0f
commit 4e772211ee

View File

@@ -39,7 +39,7 @@ jobs:
id: check-main-branch
if: ${{ steps.branch-names.outputs.base_ref_branch == 'main' }}
run: |
if ! [[ "${{ steps.branch-names.outputs.head_ref_branch }}" =~ ^(hotfix/.*|release/[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then
if ! [[ "${{ steps.branch-names.outputs.head_ref_branch }}" =~ ^(hotfix/.*|docs/.*|release/[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then
echo "reason=Invalid branch name for a Pull Request to be merged to `${{ steps.branch-names.outputs.base_ref_branch }}` branch. Pull requests must be from a hotfix or release branch." >> $GITHUB_OUTPUT
fi