@@ -5,10 +5,10 @@ import type { CommentEnhancer, CommentSpot } from '../enhancer'
55
66const GITHUB_SPOT_TYPES = [
77 'GH_PR_ADD_COMMENT' ,
8+ 'GH_ISSUE_ADD_COMMENT' ,
89 /* TODO
910 'GH_ISSUE_NEW',
1011 'GH_PR_NEW',
11- 'GH_ISSUE_ADD_COMMENT',
1212 'GH_ISSUE_EDIT_COMMENT',
1313 'GH_PR_EDIT_COMMENT',
1414 'GH_PR_CODE_COMMENT',
@@ -38,10 +38,11 @@ export class GitHubAddCommentEnhancer implements CommentEnhancer<GitHubAddCommen
3838 // Parse GitHub URL structure: /owner/repo/issues/123 or /owner/repo/pull/456
3939 logger . debug ( `${ this . constructor . name } examing url` , window . location . pathname )
4040
41- const match = window . location . pathname . match ( / ^ \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) (?: \/ p u l l \/ ( \d + ) ) / )
41+ const match = window . location . pathname . match ( / ^ \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) (?: \/ ( p u l l | i s s u e s ) \/ ( \d + ) ) / )
4242 logger . debug ( `${ this . constructor . name } found match` , window . location . pathname )
4343 if ( ! match ) return null
44- const [ , owner , repo , numberStr ] = match
44+ const [ , owner , repo , issuesOrPull , numberStr ] = match
45+ const type = issuesOrPull === 'issues' ? 'GH_ISSUE_ADD_COMMENT' : 'GH_PR_ADD_COMMENT'
4546 const slug = `${ owner } /${ repo } `
4647 const number = parseInt ( numberStr ! , 10 )
4748
@@ -51,7 +52,7 @@ export class GitHubAddCommentEnhancer implements CommentEnhancer<GitHubAddCommen
5152 domain : 'github.com' ,
5253 number,
5354 slug,
54- type : 'GH_PR_ADD_COMMENT' ,
55+ type,
5556 unique_key,
5657 }
5758 return [ this . createOvertypeFor ( textarea ) , spot ]
0 commit comments