From 28fa40faad5b20462c910346690807fb34b386bc Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 22 Aug 2019 15:06:04 -0700 Subject: [PATCH] fix: file search needs full owner/repo --- src/github.ts | 2 +- test/github.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github.ts b/src/github.ts index 3628e8365..b3a593774 100644 --- a/src/github.ts +++ b/src/github.ts @@ -889,7 +889,7 @@ export class GitHub { const response: Octokit.Response< FileSearchResponse > = await this.octokit.search.code({ - q: `filename:${filename}+repo:${this.repo}`, + q: `filename:${filename}+repo:${this.owner}/${this.repo}`, }); return response.data.items.map(file => { return file.path; diff --git a/test/github.ts b/test/github.ts index 4f6958cb4..a73cf941d 100644 --- a/test/github.ts +++ b/test/github.ts @@ -54,7 +54,7 @@ describe('GitHub', () => { readFileSync(resolve(fixturesPath, 'pom-file-search.json'), 'utf8') ); const req = nock('https://api.github.com') - .get('/search/code?q=filename%3Apom.xml+repo%3Afake') + .get('/search/code?q=filename%3Apom.xml+repo%3Afake%2Ffake') .reply(200, fileSearchResponse); const pomFiles = await github.findFilesByFilename('pom.xml'); snapshot(pomFiles);