Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/pull-request-from-branch-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@ jobs:
steps:
- name: Check branch
run: |
if [[ ${GITHUB_HEAD_REF} != development ]] && [[ ${GITHUB_HEAD_REF} != documentation ]] && ! [[ ${GITHUB_HEAD_REF} =~ ^hotfix/ ]];
echo "=== Branch Check Debug Info ==="
echo "GITHUB_HEAD_REF: '${GITHUB_HEAD_REF}'"
echo "GITHUB_HEAD_REF length: ${#GITHUB_HEAD_REF}"
echo ""
echo "Condition checks:"
[[ "${GITHUB_HEAD_REF}" == "development" ]] && echo " ✓ Is 'development' branch" || echo " ✗ Is NOT 'development' branch"
[[ "${GITHUB_HEAD_REF}" == "documentation" ]] && echo " ✓ Is 'documentation' branch" || echo " ✗ Is NOT 'documentation' branch"
[[ "${GITHUB_HEAD_REF}" =~ ^hotfix/ ]] && echo " ✓ Starts with 'hotfix/'" || echo " ✗ Does NOT start with 'hotfix/'"
echo ""

if [[ "${GITHUB_HEAD_REF}" != "development" ]] && [[ "${GITHUB_HEAD_REF}" != "documentation" ]] && ! [[ "${GITHUB_HEAD_REF}" =~ ^hotfix/ ]];
then
echo "Error: Pull request must come from 'development', 'documentation' or 'hotfix/' branch"
echo "❌ Error: Pull request must come from 'development', 'documentation' or 'hotfix/' branch"
echo " Current branch: '${GITHUB_HEAD_REF}'"
exit 1
else
echo "✅ Branch check passed!"
fi