@@ -8,7 +8,7 @@ import {Labeling} from '../../shared/labeling.js';
88export class IssueLabeling extends Labeling {
99 readonly type = 'Issue' ;
1010 /** Set of area labels available in the current repository. */
11- repoAreaLabels = new Set < string > ( ) ;
11+ repoAreaLabels = new Map < string , string > ( ) ;
1212 /** The issue data fetched from Github. */
1313 issueData ?: components [ 'schemas' ] [ 'issue' ] ;
1414
@@ -17,7 +17,7 @@ export class IssueLabeling extends Labeling {
1717
1818 // Determine if the issue already has an area label, if it does we can exit early.
1919 if (
20- this . issueData ?. labels . some ( ( label ) =>
20+ this . issueData ?. labels . some ( ( label : string | { name ?: string } ) =>
2121 ( typeof label === 'string' ? label : label . name ) ?. startsWith ( 'area: ' ) ,
2222 )
2323 ) {
@@ -35,12 +35,12 @@ Title: ${this.issueData!.title}
3535Body:
3636${ this . issueData ! . body }
3737
38- The available area labels are:
38+ The available area labels and descriptions are:
3939${ Array . from ( this . repoAreaLabels )
40- . map ( ( label ) => ` - ${ label } ` )
40+ . map ( ( [ label , description ] ) => ` - Label: " ${ label } ", Description: " ${ description } " ` )
4141 . join ( '\n' ) }
4242
43- Based on the content, which area label is the best fit?
43+ Based on the content of the issue and the labels and descriptions above , which area label is the best fit?
4444Respond ONLY with the exact label name (e.g. "area: core").
4545If you are strictly unsure or if multiple labels match equally well, respond with "ambiguous".
4646If no area label applies, respond with "none".
@@ -82,7 +82,7 @@ If no area label applies, respond with "none".
8282 . then ( ( labels ) =>
8383 labels
8484 . filter ( ( l ) => l . name . startsWith ( 'area: ' ) )
85- . forEach ( ( l ) => this . repoAreaLabels . add ( l . name ) ) ,
85+ . forEach ( ( l ) => this . repoAreaLabels . set ( l . name , l . description ?? '' ) ) ,
8686 ) ,
8787 this . git . issues . get ( { owner, repo, issue_number : context . issue . number } ) . then ( ( resp ) => {
8888 this . issueData = resp . data ;
0 commit comments