diff --git a/.github/assets/Logo.png b/.github/assets/Logo.png new file mode 100644 index 0000000..058ef0f Binary files /dev/null and b/.github/assets/Logo.png differ diff --git a/.github/workflows/branch-flow.yml b/.github/workflows/branch-flow.yml new file mode 100644 index 0000000..ff6a215 --- /dev/null +++ b/.github/workflows/branch-flow.yml @@ -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" \ No newline at end of file diff --git a/README.md b/README.md index 029276d..b98ce4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# quantex +
