vibe/.github/workflows/issue-labeler.yml
Clément Drouin ad0d5c9520
v2.13.0 (#733)
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Peter Evers <peter.evers@mistral.ai>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Val <102326092+vdeva@users.noreply.github.com>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-05-29 16:17:54 +02:00

62 lines
2.4 KiB
YAML

name: Issue Labeler
on:
issues:
types: [opened]
jobs:
label-component:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Parse bug report form
id: parse-bug
uses: stefanbuck/github-issue-parser@25f1485edffc1fee3ea68eb9f59a72e58720ffc4 # v3
with:
template-path: .github/ISSUE_TEMPLATE/bug-report.yml
continue-on-error: true
- name: Parse feature request form
id: parse-feature
uses: stefanbuck/github-issue-parser@25f1485edffc1fee3ea68eb9f59a72e58720ffc4 # v3
with:
template-path: .github/ISSUE_TEMPLATE/feature-request.yml
continue-on-error: true
- name: Apply component label
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
// Get component from either bug report or feature request
const bugComponent = '${{ steps.parse-bug.outputs.issueparser_component }}';
const featureComponent = '${{ steps.parse-feature.outputs.issueparser_component }}';
const component = bugComponent || featureComponent;
if (!component) {
console.log('No component field found, skipping labeling');
return;
}
const labels = [];
if (component === 'CLI') {
labels.push('CLI');
} else if (component === 'ACP') {
labels.push('ACP');
} else if (component === 'VS Code extension') {
labels.push('VS Code extension');
}
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labels
});
console.log(`Added labels: ${labels.join(', ')}`);
}