@@ -162,6 +162,7 @@ async function autoEvaluateDeveloper (token, owner, repo, issueNumber, username)
162162 const report = generateReport ( stats , evaluation )
163163
164164 // 所有提交自动通过,只附加rank信息
165+ console . log ( 'Creating approval comment with rank info...' )
165166 await createComment (
166167 token ,
167168 owner ,
@@ -177,11 +178,14 @@ async function autoEvaluateDeveloper (token, owner, repo, issueNumber, username)
177178 '- 📝 Make sure your public key is properly formatted between `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----` markers\n\n' +
178179 'Your certificate will be issued automatically. Please wait a moment...'
179180 )
181+ console . log ( 'Adding approved label...' )
180182 await addLabel ( token , owner , repo , issueNumber , 'approved' )
181183 console . log ( `Auto-approved: ${ username } (Rank: ${ evaluation . rank . level } )` )
182184 } catch ( error ) {
183185 console . error ( 'Error in auto-evaluation:' , error )
186+ console . error ( 'Error stack:' , error . stack )
184187 // 如果评估失败,仍然自动通过但不显示rank信息
188+ console . log ( 'Creating fallback approval comment...' )
185189 await createComment (
186190 token ,
187191 owner ,
@@ -200,6 +204,7 @@ async function autoEvaluateDeveloper (token, owner, repo, issueNumber, username)
200204 '- 📝 Make sure your public key is properly formatted\n\n' +
201205 'Your certificate will be issued automatically. Please wait a moment...'
202206 )
207+ console . log ( 'Adding approved label (fallback)...' )
203208 await addLabel ( token , owner , repo , issueNumber , 'approved' )
204209 console . log ( `Auto-approved (no rank): ${ username } ` )
205210 }
@@ -241,19 +246,25 @@ async function handleKeyringIssue () {
241246
242247 // Handle labeled event (approval)
243248 if ( action !== 'labeled' ) {
244- console . log ( 'Not a labeled or opened event' )
249+ console . log ( 'Not a labeled or opened event, action:' , action )
245250 return
246251 }
247252
253+ console . log ( 'Handling labeled event' )
248254 const label = context . payload . label
255+ console . log ( 'Label:' , label ? label . name : 'null' )
256+
249257 if ( ! label || label . name !== 'approved' ) {
250- console . log ( 'Not an approved label' )
258+ console . log ( 'Not an approved label, skipping certificate issuance ' )
251259 return
252260 }
253261
262+ console . log ( 'Approved label detected, proceeding with certificate issuance' )
254263 const approver = context . payload . sender
264+ console . log ( 'Approver:' , approver . login )
255265
256266 const publicKeyPem = extractPublicKeyFromIssue ( issueBody )
267+ console . log ( 'Public key extracted:' , publicKeyPem ? 'Yes' : 'No' )
257268
258269 if ( ! publicKeyPem ) {
259270 await createComment (
0 commit comments