Skip to content

Commit ca22183

Browse files
authored
Merge pull request #3 from github/main
Merge pull request #217 from eternalsakura/master
2 parents 8dda3a2 + 04bafc0 commit ca22183

21 files changed

Lines changed: 823 additions & 60 deletions

.github/actions/check/check-replication.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/check/check-replication.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ const run = async (): Promise<void> => {
1111
core.setFailed(`Internal error. Cannot access the internal repo ${internalRepo}. Aborting`)
1212
return
1313
} else {
14+
core.debug(`Retrieved ${internalIssues?.length} internal issues`)
1415
const externalIssues = await getIssueList(github.context.repo.owner, github.context.repo.repo, process.env['GITHUB_TOKEN'], true, true)
1516
if(!externalIssues) {
1617
core.setFailed(`Internal error when retrieving all issues.`)
1718
return
1819
}
20+
core.debug(`Retrieved ${externalIssues?.length} external issues`)
1921
let failed = false
2022
externalIssues.forEach( issue => {
2123
const ref = internalIssueAlreadyCreated(issue?.html_url, internalIssues)

.github/actions/replicate/issues.js

Lines changed: 29 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/replicate/issues.ts

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,35 @@ export const getIssueList = async (owner: string, repo: string, token: string |
1515
const octokit = new github.GitHub(token)
1616
const issueState: Issue_state = open? 'open' : 'all'
1717
// const labelFilter: string = replicate.BOUNTY_LABELS.join(',')
18-
const issues = await octokit.issues.listForRepo({
19-
owner,
20-
repo,
21-
state: issueState,
22-
per_page: per_page? per_page : 100 // TODO: implement proper pagination
23-
// labels: labelFilter -- Does not work properly
24-
})
25-
26-
issues.data.forEach(issue => {
27-
const bountyLabel = checkBountyLabels? issue.labels.some(label => {
28-
return replicate.BOUNTY_LABELS.includes(label.name as replicate.BountyType)
29-
}) : undefined
30-
if(!checkBountyLabels || bountyLabel){
31-
let item: Issue_info = {
32-
title: issue.title,
33-
author: issue.user?.login,
34-
body: issue.body? issue.body : '',
35-
number: issue.number,
36-
html_url: issue.html_url
18+
const issuesPerPage = per_page? per_page : 50
19+
let pageNb = 0
20+
do {
21+
const issues = await octokit.issues.listForRepo({
22+
owner,
23+
repo,
24+
state: issueState,
25+
per_page: issuesPerPage,
26+
page: pageNb
27+
// labels: labelFilter -- Does not work properly
28+
})
29+
30+
issues.data.forEach(issue => {
31+
const bountyLabel = checkBountyLabels? issue.labels.some(label => {
32+
return replicate.BOUNTY_LABELS.includes(label.name as replicate.BountyType)
33+
}) : undefined
34+
if(!checkBountyLabels || bountyLabel){
35+
let item: Issue_info = {
36+
title: issue.title,
37+
author: issue.user?.login,
38+
body: issue.body? issue.body : '',
39+
number: issue.number,
40+
html_url: issue.html_url
41+
}
42+
result.push(item)
3743
}
38-
result.push(item)
39-
}
40-
});
44+
});
45+
pageNb = (issues.data.length < issuesPerPage)? -1 : pageNb + 1
46+
} while (pageNb >= 0)
4147
return result
4248
} catch(error) {
4349
core.debug(error.message)

.github/actions/replicate/replicate.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/replicate/replicate.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export type Issue = {title: string, body: string, labels: string[], bountyType:
1010
type GitHubIssue = { [key: string]: any, number: number, html_url?: string | undefined, body?: string | undefined}
1111

1212
const COMMENT_TASK_LIST_AFO = `## Task List
13+
14+
- **If this is your first time in this process, have a look at that [5 min video](https://drive.google.com/drive/folders/1Jq6UfqP3CRF9Iafde86_IPAQPfdgH5rR)**
15+
- **Visit the [documented process](https://github.com/github/pe-security-lab/blob/master/docs/bug_bounty.md)**
16+
1317
- [ ] CodeQL Initial assessment - In case of rejection, please record your decision in the comment below:
1418
- [ ] Acceptance
1519
- [ ] Generate result set and post the URL in the comment
@@ -40,6 +44,10 @@ const COMMENT_TASK_LIST: CommentMap = {
4044
}
4145

4246
const COMMENT_SCORING = `## Scoring
47+
48+
- **Visit the [scoring guidelines](https://github.com/github/pe-security-lab/blob/master/docs/bug_bounty.md)**
49+
- **Accepted values are: 0 (= NA), or 1 (minimal) to 5 (maximal). Any other value will throw an error**
50+
4351
| Criterion | Score|
4452
|--- | --- |
4553
| Vulnerability Impact | |

.github/workflows/check-replication-manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Bounty issue replication workflow'
1+
name: 'Bounty issue manual replication check'
22
on: workflow_dispatch
33

44
jobs:

.github/workflows/check-replication.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Bounty issue replication workflow'
1+
name: 'Bounty issue replication check'
22
on:
33
schedule:
44
- cron: '0 17 * * *'

CodeQL_Queries/cpp/Chrome/bindings.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class StrongBinding extends ClassTemplateInstantiation {
1111
}
1212

1313
Type getBindingType() {
14-
result = this.getTemplateArgument(0).stripType()
14+
result = this.getTemplateArgument(0).(Type).stripType()
1515
}
1616
}
1717

@@ -21,7 +21,7 @@ class Binding extends ClassTemplateInstantiation {
2121
}
2222

2323
Type getBindingType() {
24-
result = this.getTemplateArgument(0).stripType()
24+
result = this.getTemplateArgument(0).(Type).stripType()
2525
}
2626
}
2727

@@ -32,7 +32,7 @@ class MojoReceiver extends ClassTemplateInstantiation {
3232
}
3333

3434
Type getBindingType() {
35-
result = this.getTemplateArgument(0).stripType()
35+
result = this.getTemplateArgument(0).(Type).stripType()
3636
}
3737
}
3838

CodeQL_Queries/cpp/Chrome/callbacks.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ predicate reach(Function f, Function g) {
104104
else
105105
overrides*(g, gc.getTarget())
106106
|
107-
g = gc.getTarget() and
108107
gc.getEnclosingFunction() = f
109108
) or
110109
exists(CallbackSinks sink | sink.getEnclosingCallable() = f and

0 commit comments

Comments
 (0)