Skip to content

Commit 750e382

Browse files
authored
Don't set source_owner and source_repo unless coming from tsgo repo (#123)
1 parent 5cb2ef8 commit 750e382

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

GithubCommentReader/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ async function sleep(ms) {
6666
* statusCommentId: number; // TODO(jakebailey): rename this
6767
* owner: string;
6868
* repo: string;
69+
* tsgo: boolean;
6970
* }} RequestInfo
7071
* @typedef {(request: RequestInfo) => Promise<Run>} CommandFn
7172
* @typedef {{ fn: CommandFn; authorAssociations: AuthorAssociation[]; prOnly: boolean, tsgoAllowed: boolean }} Command
@@ -110,10 +111,13 @@ function createParameters(info, inputs) {
110111
source_issue: `${info.issueNumber}`,
111112
requesting_user: info.requestingUser,
112113
status_comment: `${info.statusCommentId}`,
113-
source_owner: info.owner,
114-
source_repo: info.repo,
115114
};
116115

116+
if (info.tsgo) {
117+
parameters.source_owner = info.owner;
118+
parameters.source_repo = info.repo;
119+
}
120+
117121
const requiredParameters = Object.keys(parameters);
118122
const confliciting = Object.keys(inputs).filter((key) => requiredParameters.includes(key));
119123
assert(confliciting.length === 0, `Inputs conflict with required parameters: ${confliciting.join(", ")}`);
@@ -682,6 +686,7 @@ ${commandInfos.map(({ name, distinctId }) =>
682686
log: log,
683687
owner: "microsoft",
684688
repo: params.repo,
689+
tsgo,
685690
});
686691
} catch (e) {
687692
// TODO: short error message

0 commit comments

Comments
 (0)