Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Cyprien <courtot.c@gmail.com> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com> Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Quentin <quentin.torroba@mistral.ai> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: josephine-delas <57808586+josephine-delas@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
64 lines
2.5 KiB
YAML
64 lines
2.5 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
|
|
env:
|
|
BUG_COMPONENT: ${{ steps.parse-bug.outputs.issueparser_component }}
|
|
FEATURE_COMPONENT: ${{ steps.parse-feature.outputs.issueparser_component }}
|
|
with:
|
|
script: |
|
|
const bugComponent = process.env.BUG_COMPONENT;
|
|
const featureComponent = process.env.FEATURE_COMPONENT;
|
|
const component = bugComponent || featureComponent;
|
|
|
|
if (!component) {
|
|
console.log('No component field found, skipping labeling');
|
|
return;
|
|
}
|
|
|
|
const componentLabels = new Map([
|
|
['CLI', 'CLI'],
|
|
['ACP', 'ACP'],
|
|
['VS Code extension', 'VS Code extension'],
|
|
]);
|
|
const label = componentLabels.get(component);
|
|
|
|
if (!label) {
|
|
console.log(`Unknown component '${component}', skipping labeling`);
|
|
return;
|
|
}
|
|
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
labels: [label],
|
|
});
|
|
console.log(`Added label: ${label}`);
|