Skip to content

Commit

Permalink
refactor(gitea): Platform-wide getJsonFile (#9381)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Apr 3, 2021
1 parent 83fa6cd commit 425dcb5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/platform/gitea/index.ts
Expand Up @@ -208,13 +208,12 @@ const platform: Platform = {
};
},

async getJsonFile(fileName: string): Promise<any | null> {
async getJsonFile(
fileName: string,
repo: string = config.repository
): Promise<any | null> {
try {
const contents = await helper.getRepoContents(
config.repository,
fileName,
config.defaultBranch
);
const contents = await helper.getRepoContents(repo, fileName);
return JSON.parse(contents.contentString);
} catch (err) /* istanbul ignore next */ {
return null;
Expand Down

0 comments on commit 425dcb5

Please sign in to comment.