From 80666112a4a47807d003bb48bc45902502b8e349 Mon Sep 17 00:00:00 2001 From: Shavonn Brown Date: Mon, 30 Mar 2026 22:13:01 -0400 Subject: [PATCH 1/3] ci: update workflows, use release champion --- .github/release-please-config.json | 11 ---- .github/workflows/dependabot-auto-merge.yml | 73 --------------------- .github/workflows/release-please.yml | 30 --------- .github/workflows/release.yml | 22 +++++++ 4 files changed, 22 insertions(+), 114 deletions(-) delete mode 100644 .github/release-please-config.json delete mode 100644 .github/workflows/dependabot-auto-merge.yml delete mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release-please-config.json b/.github/release-please-config.json deleted file mode 100644 index 9f63549..0000000 --- a/.github/release-please-config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "release-type": "php", - "packages": { - ".": { - "changelog-path": "CHANGELOG.md", - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": false, - "versioning": "default" - } - } -} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index d995afb..0000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Dependabot Auto Merge - -on: - pull_request: - types: [ opened, synchronize, reopened ] - -permissions: - contents: write - pull-requests: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - steps: - - name: Fetch Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v2 - - - name: Wait for checks to pass - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.event.pull_request.head.sha }} - check-regexp: '.*' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - - - name: Generate semantic title - id: semantic-title - run: | - # Extract from PR title if metadata doesn't provide it - PR_TITLE="${{ github.event.pull_request.title }}" - - # Dependabot titles usually look like: "Bump package from 1.0.0 to 2.0.0" - if [[ "$PR_TITLE" =~ Bump\ (.*)\ from\ ([0-9]+)\. ]]; then - PACKAGE="${BASH_REMATCH[1]}" - OLD_MAJOR="${BASH_REMATCH[2]}" - - # Extract new version major - if [[ "$PR_TITLE" =~ to\ ([0-9]+)\. ]]; then - NEW_MAJOR="${BASH_REMATCH[1]}" - - if (( NEW_MAJOR > OLD_MAJOR )); then - PREFIX="build" # Major version bump - else - PREFIX="chore" # Minor/patch bump - fi - else - PREFIX="chore" - fi - else - # Fallback - PREFIX="chore" - PACKAGE="${{ steps.metadata.outputs.dependency-names }}" - fi - - TITLE="${PREFIX}: bump ${PACKAGE}" - echo "title=${TITLE}" >> $GITHUB_OUTPUT - - - name: Update PR title - run: | - gh pr edit ${{ github.event.pull_request.number }} \ - --title "${{ steps.semantic-title.outputs.title }}" \ - --repo ${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Approve and enable auto-merge - run: | - gh pr review ${{ github.event.pull_request.number }} --approve - gh pr merge ${{ github.event.pull_request.number }} --auto --squash - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index f39f057..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release Please - -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - checks: read - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: lewagon/wait-on-check-action@v1.4.1 - with: - ref: ${{ github.sha }} - running-workflow-name: 'Release Please' - check-regexp: 'PHP.*' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - allowed-conclusions: success - - - name: Create Release PR - uses: googleapis/release-please-action@v4 - with: - release-type: php - config-file: .github/release-please-config.json \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7156ea4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + pull_request: + types: [ closed ] + +jobs: + release: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + fetch-depth: 0 + - uses: offload-project/release-champion@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + draft-release: false From 1b26ca95c0685c6599ec131b80547e08ea3b8749 Mon Sep 17 00:00:00 2001 From: Shavonn Brown Date: Mon, 30 Mar 2026 22:13:23 -0400 Subject: [PATCH 2/3] chore: update git attrs --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitattributes b/.gitattributes index cde8b2a..52464cb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,8 @@ /phpunit.xml export-ignore /tests export-ignore /.editorconfig export-ignore +/phpstan.neon export-ignore +/captainhook.json export-ignore +/pint.json export-ignore +/CHANGELOG.md export-ignore +/README.md export-ignore From 6e0f00e8a0d0b6ec8cbefdb628fc1e9f2ee7bddb Mon Sep 17 00:00:00 2001 From: Shavonn Brown Date: Mon, 30 Mar 2026 22:14:08 -0400 Subject: [PATCH 3/3] chore: add composer captainhook install script --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c5a13ef..c2087c1 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,8 @@ "test-coverage": "pest --coverage", "analyse": "phpstan analyse --memory-limit=-1", "analyse-baseline": "phpstan analyse --memory-limit=-1 --generate-baseline", - "pint": "vendor/bin/pint" + "pint": "vendor/bin/pint", + "install-hooks": "vendor/bin/captainhook install --only-enabled" }, "extra": { "laravel": {