Skip to content

Commit

Permalink
fix: file search needs full owner/repo (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 authored and bcoe committed Aug 22, 2019
1 parent 56aed5e commit 1757a9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1757a9e

Please sign in to comment.