@@ -46,12 +46,13 @@ function diff(
4646 target : number ,
4747 current : Set < string > ,
4848 desired : Set < string > ,
49- comment ?: string
49+ comment ?: string ,
50+ meta ?: { title ?: string ; url ?: string }
5051) : LabelOp | null {
5152 const add = [ ...desired ] . filter ( ( l ) => ! current . has ( l ) ) ;
5253 const remove = [ ...current ] . filter ( ( l ) => ! desired . has ( l ) ) ;
5354 if ( add . length === 0 && remove . length === 0 && ! comment ) return null ;
54- return { target, add, remove, comment } ;
55+ return { target, title : meta ?. title , url : meta ?. url , add, remove, comment } ;
5556}
5657
5758// ---------------------------------------------------------------------------
@@ -88,7 +89,10 @@ export function computeIssuePatch({ issue, currentLabels }: IssueState): Patch {
8889 desired . delete ( BOUNTY_CLAIMED ) ;
8990 }
9091
91- const op = diff ( issue . number , currentLabels , desired ) ;
92+ const op = diff ( issue . number , currentLabels , desired , undefined , {
93+ title : issue . title ,
94+ url : issue . html_url ,
95+ } ) ;
9296 return { ops : op ? [ op ] : [ ] } ;
9397}
9498
@@ -131,7 +135,10 @@ export function computePrPatch({ pr, currentLabels, linkedIssues }: PrState): Pa
131135 // Rule 2 — rewarded lifecycle.
132136 prDesired . add ( BOUNTY_REWARDED ) ;
133137
134- const prOp = diff ( pr . number , currentLabels , prDesired ) ;
138+ const prOp = diff ( pr . number , currentLabels , prDesired , undefined , {
139+ title : pr . title ,
140+ url : pr . html_url ,
141+ } ) ;
135142 if ( prOp ) ops . push ( prOp ) ;
136143
137144 // Update linked issues — only those that already have a bounty value label.
@@ -144,12 +151,18 @@ export function computePrPatch({ pr, currentLabels, linkedIssues }: PrState): Pa
144151 issueDesired . add ( BOUNTY_REWARDED ) ;
145152 issueDesired . delete ( BOUNTY_CLAIMED ) ;
146153
147- const op = diff ( issue . number , issueCurrent , issueDesired ) ;
154+ const op = diff ( issue . number , issueCurrent , issueDesired , undefined , {
155+ title : issue . title ,
156+ url : issue . html_url ,
157+ } ) ;
148158 if ( op ) ops . push ( op ) ;
149159 }
150160 } else {
151161 // Rule 1 — label propagation (pre-merge).
152- const prOp = diff ( pr . number , currentLabels , prDesired ) ;
162+ const prOp = diff ( pr . number , currentLabels , prDesired , undefined , {
163+ title : pr . title ,
164+ url : pr . html_url ,
165+ } ) ;
153166 if ( prOp ) ops . push ( prOp ) ;
154167
155168 // Rule 3 — comment on each issue whose value label was newly propagated.
@@ -159,6 +172,8 @@ export function computePrPatch({ pr, currentLabels, linkedIssues }: PrState): Pa
159172 if ( hadValueLabel ) {
160173 ops . push ( {
161174 target : issue . number ,
175+ title : issue . title ,
176+ url : issue . html_url ,
162177 add : [ ] ,
163178 remove : [ ] ,
164179 comment : `PR [#${ pr . number } ](${ pr . html_url } ) has been opened for this bounty by @${ pr . user . login } .` ,
0 commit comments