feat(wasm): bypass NAPI-RS — direct C-ABI over wasm32-wasip1 #80
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: PR Labeler | |
| on: | |
| pull_request_target: | |
| types: [opened, edited] | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = context.payload.pull_request.title; | |
| const match = title.match(/^([a-zA-Z]+)(\(.+?\))?(!)?:\s/); | |
| const prefixMap = { | |
| 'feat': 'feat', 'fix': 'fix', 'refactor': 'refactor', | |
| 'docs': 'docs', 'test': 'test', 'chore': 'chore', | |
| 'perf': 'perf', 'ci': 'ci', 'build': 'build', | |
| }; | |
| const expectedLabels = new Set(); | |
| if (match) { | |
| const type = match[1].toLowerCase(); | |
| const scope = match[2] ? match[2].toLowerCase() : ''; | |
| const isBreaking = match[3] === '!'; | |
| if (prefixMap[type]) expectedLabels.add(prefixMap[type]); | |
| if (isBreaking) expectedLabels.add('breaking'); | |
| if (scope.includes('deps')) expectedLabels.add('dependencies'); | |
| } | |
| const { data: currentLabelsData } = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| }); | |
| const currentLabels = currentLabelsData.map(l => l.name); | |
| const allManagedLabels = [...Object.values(prefixMap), 'breaking', 'dependencies']; | |
| const labelsToAdd = [...expectedLabels].filter(l => !currentLabels.includes(l)); | |
| const labelsToRemove = currentLabels.filter(l => | |
| allManagedLabels.includes(l) && !expectedLabels.has(l) | |
| ); | |
| if (labelsToAdd.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| labels: labelsToAdd, | |
| }); | |
| } | |
| for (const label of labelsToRemove) { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| name: label, | |
| }); | |
| } |