phpcq/branch-alias-validation
feature/, release/) must logically progress with tags (e.g., v1.0.0).php artisan validate:branches) for developer workflows.postcss or webpack hooks).require-dev and a CLI binary.release/ branches (e.g., release/2.x may lag v2.0.0 during stabilization).main/develop branches that intentionally diverge from tags.["main", "develop"]).alpha-* tags).git tag, git merge-base) can add 5–30 seconds to CI pipelines for large repos.git fetch --tags once per job).feature/*, release/*).feature/, hotfix/)? If not, validation may fail unpredictably.GET /api/branch-validation) for frontend checks?main can lag tags)?v*.*.*-rc.*)?storage/logs/laravel.log or show in admin panel.git push locally.pre-push script)?BranchValidationPolicy for authorization)?php artisan validate:branches.git:pre-push, deploy).feature/* branches).before_script to install Git and run validation.run command with Git preinstalled..git/hooks/pre-push to block stale branches.Phase 1: Composer Integration (1 hour)
composer.json:
"require-dev": {
"phpcq/branch-alias-validation": "^1.0"
}
composer install../vendor/bin/validate-branch-alias.php
Phase 2: CI Validation (2 hours)
- name: Validate branch alias
if: contains(github.ref, 'feature/') || contains(github.ref, 'release/')
run: ./vendor/bin/validate-branch-alias.php
validate_branch:
script:
- ./vendor/bin/validate-branch-alias.php
rules:
- if: $CI_COMMIT_REF_NAME =~ /^feature\/|release\//
Phase 3: Laravel Integration (Optional, 4 hours)
php artisan make:command ValidateBranches
// app/Console/Commands/ValidateBranches.php
public function handle() {
$exitCode = shell_exec('php ' . base_path('vendor/bin/validate-branch-alias.php'));
if ($exitCode !== 0) {
$this->error('Branch validation failed! Fix before merging.');
exit(1);
}
}
// app/Console/Kernel.php
protected $commands = [
Commands\ValidateBranches::class,
];
php artisan validate:branches
Phase 4: Customization (If Needed, 8 hours)
validate-branch-alias.php to:
.branch-validation.json).{
"whitelist": ["main", "develop"],
"ignoreTags": ["v*.*.*-rc.*"]
}
php artisan vendor:publish.BranchValidationService to reuse logic in policies/controllers.git merge-base). 99% of modern setups (2018+) are compatible.php-version support).
| Step | Priority | Effort | Dependencies | Owner |
|---|---|---|---|---|
Add to composer.json |
Critical | Low | None | PM/Dev |
How can I help you explore Laravel packages today?