diff --git a/.github/workflows/pr-into-dev.yml b/.github/workflows/pr-into-dev.yml index c60d99f..88d1c17 100644 --- a/.github/workflows/pr-into-dev.yml +++ b/.github/workflows/pr-into-dev.yml @@ -27,33 +27,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Validate branch name - id: branch-name - run: | - BRANCH_NAME="${{ github.head_ref }}" - echo "Branch name: $BRANCH_NAME" - - # Valid prefixes for dev branch - VALID_PREFIXES="feature/ fix/ hotfix/ test/ refactor/ docs/" - - VALID=false - for prefix in $VALID_PREFIXES; do - if [[ "$BRANCH_NAME" == $prefix* ]]; then - VALID=true - echo "✅ Branch name is valid (starts with $prefix)" - break - fi - done - - if [ "$VALID" = false ]; then - echo "::error::Invalid branch name: $BRANCH_NAME" - echo "::error::Branch must start with one of: $VALID_PREFIXES" - echo "valid=false" >> $GITHUB_OUTPUT - exit 1 - else - echo "valid=true" >> $GITHUB_OUTPUT - fi - - name: Validate PR title (Conventional Commits) id: pr-title run: | @@ -107,17 +80,10 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const branchValid = '${{ steps.branch-name.outputs.valid }}'; const titleValid = '${{ steps.pr-title.outputs.valid }}'; let comment = '## ❌ PR Validation Failed\n\n'; - if (branchValid !== 'true') { - comment += '### Branch Name\n'; - comment += '- ❌ Branch name must start with: `feature/`, `fix/`, `hotfix/`, `test/`, `refactor/`, or `docs/`\n'; - comment += `- Current branch: \`${{ github.head_ref }}\`\n\n`; - } - if (titleValid !== 'true') { comment += '### PR Title\n'; comment += '- ❌ PR title must follow Conventional Commits format\n'; @@ -127,9 +93,8 @@ jobs: } comment += '### How to Fix\n\n'; - comment += '1. Rename your branch if needed: `git branch -m new-branch-name`\n'; - comment += '2. Update PR title to follow Conventional Commits format\n'; - comment += '3. Push changes and re-run checks\n\n'; + comment += '1. Update PR title to follow Conventional Commits format\n'; + comment += '2. Push changes and re-run checks\n\n'; comment += '📚 See [CONTRIBUTING.md](../blob/main/docs/CONTRIBUTING.md) for more details.'; await github.rest.issues.createComment({ @@ -139,7 +104,7 @@ jobs: body: comment }); - quality-checks: + quality-gates: name: Run Quality Checks needs: validate-pr uses: ./.github/workflows/reusable-pr-checks.yml @@ -152,7 +117,7 @@ jobs: pr-summary: name: PR Summary - needs: [validate-pr, quality-checks] + needs: [validate-pr, quality-gates] runs-on: ubuntu-latest if: always() diff --git a/CHANGELOG.md b/CHANGELOG.md index ab816ad..cfcfd52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [Unreleased] + +### Fixed +- **Installation Script:** Fixed bash syntax error in `install.sh` caused by missing quotes around color variables in `read -p` commands (#13) + - Added proper quoting around `${BLUE}` and `${NC}` variables in command substitution + - Prevents "syntax error near unexpected token" during installation on macOS + - Affects lines 132 and 179 in install.sh +- **CI Workflow:** Removed strict branch naming requirement for PRs into dev (#17) + - Contributors can now use any branch name when creating PRs + - Reduces friction for external contributors and fork PRs + - Maintains PR title validation (Conventional Commits) for commit hygiene + +--- + ## [1.0.0] - 2025-11-12 ### 🎉 Initial Release diff --git a/install.sh b/install.sh index f4a5b8b..e70b806 100755 --- a/install.sh +++ b/install.sh @@ -129,7 +129,7 @@ echo " • Agent: $AGENTS_DIR/claude-md-guardian.md" echo "" # Confirm installation -read -p "$(echo -e ${BLUE}Proceed with installation? [Y/n]:${NC} )" confirm < /dev/tty +read -p "$(echo -e "${BLUE}Proceed with installation? [Y/n]:${NC}")" confirm < /dev/tty confirm=${confirm:-Y} if [[ ! $confirm =~ ^[Yy]$ ]]; then @@ -176,7 +176,7 @@ print_success "Agent installed → $AGENTS_DIR/claude-md-guardian.md" # Optional: Install quality hooks echo "" -read -p "$(echo -e ${BLUE}Would you like to install quality hooks (pre-commit validation)? [y/N]:${NC} )" install_hooks < /dev/tty +read -p "$(echo -e "${BLUE}Would you like to install quality hooks (pre-commit validation)? [y/N]:${NC}")" install_hooks < /dev/tty install_hooks=${install_hooks:-N} if [[ $install_hooks =~ ^[Yy]$ ]]; then