build(deps-dev): Bump vite from 8.0.3 to 8.0.5 in the npm_and_yarn group across 1 directory #104
Workflow file for this run
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: Label PR | |
| on: | |
| pull_request_target: | |
| types: [opened, edited] | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Apply label based on Conventional Commits prefix | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = context.payload.pull_request.title; | |
| const prefixMatch = title.match(/^(\w+)(?:\([^)]*\))?(!)?:/); | |
| if (!prefixMatch) return; | |
| const prefix = prefixMatch[1].toLowerCase(); | |
| const isBreaking = prefixMatch[2] === '!'; | |
| const labelMap = { | |
| feat: '[Type] Enhancement', | |
| fix: '[Type] Bug', | |
| perf: '[Type] Performance', | |
| test: '[Type] Automated Testing', | |
| docs: '[Type] Developer Documentation', | |
| build: '[Type] Build Tooling', | |
| ci: '[Type] Build Tooling', | |
| refactor: '[Type] Task', | |
| task: '[Type] Task', | |
| chore: '[Type] Task', | |
| style: '[Type] Task', | |
| }; | |
| const typeLabel = isBreaking ? '[Type] Breaking Change' : labelMap[prefix]; | |
| if (!typeLabel) return; | |
| const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| }); | |
| const allTypeLabels = [...Object.values(labelMap), '[Type] Breaking Change']; | |
| const hasConflictingLabel = currentLabels.some( | |
| (l) => allTypeLabels.includes(l.name) && l.name !== typeLabel | |
| ); | |
| if (hasConflictingLabel) return; | |
| const alreadyLabeled = currentLabels.some((l) => l.name === typeLabel); | |
| if (alreadyLabeled) return; | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| labels: [typeLabel], | |
| }); |