Skip to content

Commit 24c964a

Browse files
authored
Merge branch 'main' into createcard
2 parents 564fa37 + be47995 commit 24c964a

14 files changed

Lines changed: 769 additions & 54 deletions

File tree

.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: 2 additions & 2 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type GitHubIssue = { [key: string]: any, number: number, html_url?: string | und
1111

1212
const COMMENT_TASK_LIST_AFO = `## Task List
1313
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)**
14+
- **If this is your first time in this process, have a look at that [5 min video](https://drive.google.com/file/d/1Uy3JukURoSk-2Bq7EjyagVdpsyvKI67E)**
1515
- **Visit the [documented process](https://github.com/github/pe-security-lab/blob/main/docs/bug_bounty.md)**
1616
1717
- [ ] CodeQL Initial assessment - In case of rejection, please record your decision in the comment below:

.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/actions/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Created by @adityasharad, extended by @jarlob.
2+
Read more on [https://securitylab.github.com/research/github-actions-untrusted-input](https://securitylab.github.com/research/github-actions-untrusted-input).

0 commit comments

Comments
 (0)