chore(main): release 6.6.0 #490
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: "Check PR" | |
| on: | |
| pull_request: | |
| types: [opened, edited, reopened, labeled, unlabeled, synchronize] | |
| jobs: | |
| lint-pr-name: | |
| name: Validate PR title | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| steps: | |
| - uses: amannn/action-semantic-pull-request@v6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| label-pr: | |
| name: Add labels based on PR title | |
| runs-on: ubuntu-latest | |
| # 跳过 fork PR(避免 "Resource not accessible by integration" 错误) | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Extract type from PR title | |
| id: extract | |
| run: | | |
| title="${{ github.event.pull_request.title }}" | |
| type=$(echo "$title" | sed -E 's/^([a-zA-Z]+)(\(.+\))?:.*/\1/' | tr '[:upper:]' '[:lower:]') | |
| echo "type=$type" >> $GITHUB_OUTPUT | |
| - name: Determine label to add | |
| id: label | |
| run: | | |
| type="${{ steps.extract.outputs.type }}" | |
| label="" | |
| case "$type" in | |
| fix) label="bug" ;; | |
| docs) label="documentation" ;; | |
| feat) label="enhancement" ;; | |
| chore) label="misc" ;; | |
| test) label="test" ;; | |
| build|ci) label="configuration" ;; | |
| refactor|style|performance) label="misc" ;; | |
| breaking) label="breaking change" ;; | |
| esac | |
| echo "label=$label" >> $GITHUB_OUTPUT | |
| - name: Check existing labels | |
| id: check | |
| run: | | |
| if [[ "${{ contains(join(github.event.pull_request.labels.*.name, ' '), steps.label.outputs.label) }}" == "true" ]]; then | |
| echo "already_exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "already_exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Add label if not exists | |
| if: steps.label.outputs.label != '' && steps.check.outputs.already_exists == 'false' | |
| uses: actions-ecosystem/action-add-labels@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| labels: ${{ steps.label.outputs.label }} |