diff --git a/GithubCommentReader/index.js b/GithubCommentReader/index.js index 557d2ef..8cdea3a 100644 --- a/GithubCommentReader/index.js +++ b/GithubCommentReader/index.js @@ -66,6 +66,7 @@ async function sleep(ms) { * statusCommentId: number; // TODO(jakebailey): rename this * owner: string; * repo: string; + * tsgo: boolean; * }} RequestInfo * @typedef {(request: RequestInfo) => Promise} CommandFn * @typedef {{ fn: CommandFn; authorAssociations: AuthorAssociation[]; prOnly: boolean, tsgoAllowed: boolean }} Command @@ -110,10 +111,13 @@ function createParameters(info, inputs) { source_issue: `${info.issueNumber}`, requesting_user: info.requestingUser, status_comment: `${info.statusCommentId}`, - source_owner: info.owner, - source_repo: info.repo, }; + if (info.tsgo) { + parameters.source_owner = info.owner; + parameters.source_repo = info.repo; + } + const requiredParameters = Object.keys(parameters); const confliciting = Object.keys(inputs).filter((key) => requiredParameters.includes(key)); assert(confliciting.length === 0, `Inputs conflict with required parameters: ${confliciting.join(", ")}`); @@ -682,6 +686,7 @@ ${commandInfos.map(({ name, distinctId }) => log: log, owner: "microsoft", repo: params.repo, + tsgo, }); } catch (e) { // TODO: short error message