()
| 234 | * Fetches issues across all repositories in the ORG |
| 235 | */ |
| 236 | const fetchIssues = async () => { |
| 237 | try { |
| 238 | const baseURL = config.get("githubApi.baseUrl"); |
| 239 | const issues = "/issues"; |
| 240 | const urlObj = new URL(baseURL); |
| 241 | urlObj.pathname = "orgs" + "/" + config.get("githubApi.org") + issues; |
| 242 | const createdURL = urlObj.href; |
| 243 | const res = await getFetchWithAuthToken( |
| 244 | createdURL, |
| 245 | { |
| 246 | filter: "all", |
| 247 | state: "open", |
| 248 | }, |
| 249 | { |
| 250 | Accept: "application/vnd.github+json", |
| 251 | // TODO: replace <AUTH-TOKEN> with RDS org PAT |
| 252 | Authorization: `Bearer <AUTH-TOKEN>`, |
| 253 | org: config.get("githubApi.org"), |
| 254 | } |
| 255 | ); |
| 256 | return res; |
| 257 | } catch (err) { |
| 258 | logger.error(`Error while fetching issues: ${err}`); |
| 259 | throw err; |
| 260 | } |
| 261 | }; |
| 262 | |
| 263 | /** |
| 264 | * Fetches issues for given repository and id |
nothing calls this directly
no test coverage detected