{"record":{"id":"7ee3bfd5c928ed45","repo":"OtterMind/Chat2DB","slug":"gh-project-token-is-required","errorCode":null,"errorMessage":"GH_PROJECT_TOKEN is required.","messagePattern":"GH_PROJECT_TOKEN is required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/github/sync-community-project.js","lineNumber":41,"sourceCode":"  }\n  return pullRequest.draft ? 'In Progress' : 'In Review';\n}\n\nfunction fallbackIssueStatus(issue) {\n  if (String(issue.state).toLowerCase() === 'closed') return 'Done';\n  const labels = new Set((issue.labels || []).map((label) => label.name || label));\n  return [...ELIGIBLE_LABELS].some((label) => labels.has(label)) ? 'Ready' : 'Backlog';\n}\n\nfunction issueEventStatus(action, issue) {\n  if (action === 'closed') return 'Done';\n  if (action === 'reopened') return fallbackIssueStatus(issue);\n  return 'Inbox';\n}\n\nclass GitHubClient {\n  constructor({ token, repository, apiUrl = 'https://api.github.com' }) {\n    if (!token) throw new Error('GH_PROJECT_TOKEN is required.');\n    const [owner, repo] = String(repository || '').split('/');\n    if (!owner || !repo) throw new Error('GITHUB_REPOSITORY must be owner/repository.');\n    this.token = token;\n    this.owner = owner;\n    this.repo = repo;\n    this.apiUrl = apiUrl.replace(/\\/$/, '');\n  }\n\n  async request(endpoint, { method = 'GET', body } = {}) {\n    const response = await fetch(`${this.apiUrl}${endpoint}`, {\n      method,\n      headers: {\n        Accept: 'application/vnd.github+json',\n        Authorization: `Bearer ${this.token}`,\n        'Content-Type': 'application/json',\n        'X-GitHub-Api-Version': '2022-11-28',\n      },\n      body: body === undefined ? undefined : JSON.stringify(body),","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/script/github/sync-community-project.js#L23-L59","documentation":"Error \"GH_PROJECT_TOKEN is required.\" thrown in OtterMind/Chat2DB.","triggerScenarios":"The sync-community-project.js script started without GH_PROJECT_TOKEN defined in the environment.","commonSituations":"See trigger scenarios.","solutions":["Set the GH_PROJECT_TOKEN environment variable to a GitHub token with project read/write scope before running the script.","In CI, add GH_PROJECT_TOKEN to the workflow env block from repository secrets."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}