mirror of
https://github.com/status-im/status-github-bot.git
synced 2025-01-13 23:06:02 +00:00
Minor performance improvement
This commit is contained in:
parent
8ddcfee6aa
commit
2efe7e508c
@ -82,6 +82,10 @@ async function _getProjectCardForIssue (github, columnId, issueUrl) {
|
||||
}
|
||||
|
||||
async function _getOrgProjectByName (github, robot, orgName, projectName, botName) {
|
||||
if (!projectName) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
// Fetch org projects
|
||||
// TODO: The org project and project column info should be cached
|
||||
@ -107,6 +111,10 @@ async function _getOrgProjectByName (github, robot, orgName, projectName, botNam
|
||||
}
|
||||
|
||||
async function _getRepoProjectByName (github, robot, repoInfo, projectName, botName) {
|
||||
if (!projectName) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
const ghprojectsPayload = await github.projects.getRepoProjects({ ...repoInfo, state: 'open' })
|
||||
const project = ghprojectsPayload.data.find(p => p.name === projectName)
|
||||
@ -128,6 +136,9 @@ async function _getProjectColumnByName (github, robot, project, columnName, botN
|
||||
if (!project) {
|
||||
return null
|
||||
}
|
||||
if (!columnName) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
const ghcolumnsPayload = await github.projects.getProjectColumns({ project_id: project.id })
|
||||
|
Loading…
x
Reference in New Issue
Block a user