fix: trigger Homebrew tap update from release workflow #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Drafter | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| update_release_draft: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: release-drafter/release-drafter@v6 | |
| with: | |
| config-name: release-drafter.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Auto-label PRs based on conventional commit titles | |
| label: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = context.payload.pull_request.title.toLowerCase(); | |
| const labels = []; | |
| if (title.startsWith('feat')) labels.push('feature'); | |
| else if (title.startsWith('fix')) labels.push('fix'); | |
| else if (title.startsWith('docs')) labels.push('documentation'); | |
| else if (title.startsWith('chore')) labels.push('chore'); | |
| else if (title.startsWith('refactor')) labels.push('refactor'); | |
| else if (title.startsWith('security') || title.includes('security')) labels.push('security'); | |
| else if (title.startsWith('deps') || title.includes('dependencies')) labels.push('dependencies'); | |
| if (title.includes('breaking') || title.includes('!:')) labels.push('breaking'); | |
| if (labels.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| labels: labels | |
| }); | |
| } |