diff --git a/.github/workflows/branch-name-check.yml b/.github/workflows/branch-name-check.yml deleted file mode 100644 index 0d4e153..0000000 --- a/.github/workflows/branch-name-check.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Enforce Branch Naming Convention with Auto-Increment - -on: - push: - branches: - - 'feature/*' # Trigger on push to any feature branch (feature/*) - -jobs: - auto_increment: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v2 - - - name: Fetch last feature number and increment - run: | - # Fetch the last used feature number from the file (if it exists) - if [ -f last-feature-number.txt ]; then - LAST_NUMBER=$(cat last-feature-number.txt) - else - LAST_NUMBER=0 # Start from 0 if the file doesn't exist - fi - - # Increment the feature number by 1 - NEXT_NUMBER=$((LAST_NUMBER + 1)) - - # Create the new branch name based on the incremented number - BRANCH_NAME="feature-$NEXT_NUMBER" - - # Update the last feature number file - echo $NEXT_NUMBER > last-feature-number.txt - - echo "Creating new branch with name: $BRANCH_NAME" - - # Create the branch locally and push it to the remote repository - git checkout -b $BRANCH_NAME - git push origin $BRANCH_NAME - - # Commit and push the updated last feature number file - git add last-feature-number.txt - git commit -m "Update feature number to $NEXT_NUMBER" - git push origin main # Push the updated feature number file to the default branch (main) -