What
It seems that variables in repoData are sometimes undefined
|
const repoData = await Promise.all( |
|
repoList.map(async (repo) => { |
|
const url = `https://circleci.com/api/v2/project/gh/${repo}/envvar`; |
|
const results = await fetch(url, { |
|
headers: { "Circle-Token": `${CIRCLE_TOKEN}` }, |
|
}).then((res) => res.json()); |
|
|
|
return { |
|
name: repo, |
|
variables: results.items, |
|
}; |
|
}) |
|
); |
|
USER_DATA.projects = repoData.filter((repo) => repo.variables.length > 0); |
Log
file:///project/index.js:150
USER_DATA.projects = repoData.filter((repo) => repo.variables.length > 0);
^
TypeError: Cannot read properties of undefined (reading 'length')
at file:///project/index.js:150:63
at Array.filter (<anonymous>)
at file:///project/index.js:150:31
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v19.3.0
What
It seems that variables in repoData are sometimes undefined
CircleCI-Env-Inspector/index.js
Lines 136 to 149 in f234e25
Log