Skip to content
Merged
Show file tree
Hide file tree
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
Binary file added .github/assets/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions .github/workflows/branch-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Branch Flow Protection

on:
pull_request:

jobs:
enforce-branch-flow:
runs-on: ubuntu-latest

steps:
- name: Validate PR branch flow
env:
SOURCE: ${{ github.head_ref }}
TARGET: ${{ github.base_ref }}

run: |
echo "PR: $SOURCE -> $TARGET"

case "$SOURCE" in

# Block main going into lower branches
main)
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ main cannot merge downward."
echo "⚠️ Error: Merging from main into '$TARGET' is prohibited."
exit 1
;;

# Release branches can only go into main or develop
release/*)
if [[ "$TARGET" != "main" && "$TARGET" != "develop" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ release/* branches must target main or develop."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# Hotfix/* branches can only go into main or release
hotfix/*)
if [[ "$TARGET" != "main" && "$TARGET" != "release" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ hotfix/* branches must target main or release/*."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# Develop branches can only go into release
develop)
if [["$TARGET" != release/* ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ develop branch must target release/*."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# New-Features branches can only go into develop
new-features)
if [[ "$TARGET" != "develop" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ new-features branch must target develop."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# Features/* branches can only go into feature
feature/*)
if [[ "$TARGET" != "new-features" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ feature/* branches must target feature."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# Bug-fixes branches can only go into develop
bug-fixes)
if [[ "$TARGET" != "develop" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ bug-fixes branch must target develop."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

# Bugfixes/* branches can only go into bugfix
bugfix/*)
if [[ "$TARGET" != "bugfix" ]]; then
echo "🚀 $SOURCE -❌-> 🎯 $TARGET"
echo " "
echo "❌ bugfix/* branches must target bugfix."
echo "⚠️ Error: Merging from $SOURCE into '$TARGET' is prohibited."
exit 1
fi
;;

esac

echo "✅ Branch flow is valid."
echo " "
echo "🚀 $SOURCE -✅-> 🎯 $TARGET"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# quantex
<p align=center><img alt="" src=".github/assets/Logo.png" width=200 style="cursor: default;"></p>

<h1 align=center>quantex</h1>

<!-- # quantex -->
Quantex — a lightweight, open-source code editor designed for speed, simplicity, and a futuristic coding experience. Built to help developers write, navigate, and manage code effortlessly with a clean and modern interface.

<div align="center">
Expand Down