Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/check/check-replication.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/actions/check/check-replication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ const run = async (): Promise<void> => {
core.setFailed(`Internal error. Cannot access the internal repo ${internalRepo}. Aborting`)
return
} else {
core.debug(`Retrieved ${internalIssues?.length} internal issues`)
const externalIssues = await getIssueList(github.context.repo.owner, github.context.repo.repo, process.env['GITHUB_TOKEN'], true, true)
if(!externalIssues) {
core.setFailed(`Internal error when retrieving all issues.`)
return
}
core.debug(`Retrieved ${externalIssues?.length} external issues`)
let failed = false
externalIssues.forEach( issue => {
const ref = internalIssueAlreadyCreated(issue?.html_url, internalIssues)
Expand Down
52 changes: 29 additions & 23 deletions .github/actions/replicate/issues.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 28 additions & 22 deletions .github/actions/replicate/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,35 @@ export const getIssueList = async (owner: string, repo: string, token: string |
const octokit = new github.GitHub(token)
const issueState: Issue_state = open? 'open' : 'all'
// const labelFilter: string = replicate.BOUNTY_LABELS.join(',')
const issues = await octokit.issues.listForRepo({
owner,
repo,
state: issueState,
per_page: per_page? per_page : 100 // TODO: implement proper pagination
// labels: labelFilter -- Does not work properly
})

issues.data.forEach(issue => {
const bountyLabel = checkBountyLabels? issue.labels.some(label => {
return replicate.BOUNTY_LABELS.includes(label.name as replicate.BountyType)
}) : undefined
if(!checkBountyLabels || bountyLabel){
let item: Issue_info = {
title: issue.title,
author: issue.user?.login,
body: issue.body? issue.body : '',
number: issue.number,
html_url: issue.html_url
const issuesPerPage = per_page? per_page : 50
let pageNb = 0
do {
const issues = await octokit.issues.listForRepo({
owner,
repo,
state: issueState,
per_page: issuesPerPage,
page: pageNb
// labels: labelFilter -- Does not work properly
})

issues.data.forEach(issue => {
const bountyLabel = checkBountyLabels? issue.labels.some(label => {
return replicate.BOUNTY_LABELS.includes(label.name as replicate.BountyType)
}) : undefined
if(!checkBountyLabels || bountyLabel){
let item: Issue_info = {
title: issue.title,
author: issue.user?.login,
body: issue.body? issue.body : '',
number: issue.number,
html_url: issue.html_url
}
result.push(item)
}
result.push(item)
}
});
});
pageNb = (issues.data.length < issuesPerPage)? -1 : pageNb + 1
} while (pageNb >= 0)
return result
} catch(error) {
core.debug(error.message)
Expand Down
7 changes: 7 additions & 0 deletions .github/actions/replicate/replicate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/check-replication-manual.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Bounty issue replication workflow'
name: 'Bounty issue manual replication check'
on: workflow_dispatch

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-replication.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Bounty issue replication workflow'
name: 'Bounty issue replication check'
on:
schedule:
- cron: '0 17 * * *'
Expand Down