@@ -3,9 +3,12 @@ import * as github from '@actions/github'
33import { WebhookPayload } from '@actions/github/lib/interfaces'
44import { getIssueList , internalIssueAlreadyCreated , isUserAlreadyParticipant } from './issues'
55
6- export type Issue = { title : string , body : string , labels : string [ ] }
7- export const BOUNTY_LABELS : string [ ] = [ 'All For One' , 'The Bug Slayer' ]
8- const COMMENT_TASK_LIST = `## Task List
6+ export const BOUNTY_LABELS = [ 'All For One' , 'The Bug Slayer' ] as const
7+ export type BountyType = typeof BOUNTY_LABELS [ number ]
8+ type CommentMap = { [ K in BountyType ] : string }
9+ export type Issue = { title : string , body : string , labels : string [ ] , bountyType : BountyType }
10+
11+ const COMMENT_TASK_LIST_AFO = `## Task List
912- [ ] Initial assessment - Please record your decision in the comment below
1013 - [ ] CodeQL
1114 - [ ] Security Lab
@@ -21,6 +24,20 @@ const COMMENT_TASK_LIST = `## Task List
2124- [ ] Bounty Payment
2225`
2326
27+ const COMMENT_TASK_LIST_BS = `## Task List
28+ - [ ] Initial assessment from Security Lab
29+ - [ ] Security Lab assessment:
30+ - [ ] Confirm the CVE
31+ - [ ] Assess the Vulnerability Impact, the Vulnerability Scope
32+ - [ ] Get the CodeQL scores (False Positive ratio, Code Maturity and the Documentation) from the previous query rating
33+ - [ ] PR is merged? Finalize the score
34+ - [ ] Bounty Payment`
35+
36+ const COMMENT_TASK_LIST : CommentMap = {
37+ 'All For One' : COMMENT_TASK_LIST_AFO ,
38+ 'The Bug Slayer' : COMMENT_TASK_LIST_BS
39+ }
40+
2441const COMMENT_SCORING = `## Scoring
2542| Criterion | Score|
2643|--- | --- |
@@ -40,7 +57,7 @@ const COMMENT_FIRST_SUBMISSION = `## :tada: First submission for this user :tada
4057
4158export const generateInternalIssueContentFromPayload = async ( payload : WebhookPayload ) : Promise < Issue | undefined > => {
4259 const issue = payload . issue
43- let result : Issue = { title : " none" , body : " none" , labels : [ ] }
60+ let result : Issue = { title : ' none' , body : ' none' , labels : [ ] , bountyType : 'All For One' }
4461 let bountyIssue : boolean = false
4562 let bountyType = ''
4663
@@ -103,7 +120,7 @@ export const createInternalIssue = async (payload: WebhookPayload, issue: Issue)
103120 owner,
104121 repo,
105122 issue_number : internal_ref ,
106- body : COMMENT_TASK_LIST ,
123+ body : COMMENT_TASK_LIST [ issue . bountyType ] ,
107124 } )
108125 core . debug ( `comment created ${ issueCommentResponse1 . data . url } ` )
109126
0 commit comments