Skip to content

Commit

Permalink
feat(cache): cache http response for files in same org (#27045)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
  • Loading branch information
2 people authored and pull[bot] committed Apr 29, 2024
1 parent c1cf478 commit 22723cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/modules/platform/github/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,10 @@ export async function getRawFile(
branchOrTag?: string,
): Promise<string | null> {
const repo = repoName ?? config.repository;
const isSameOrg = repo?.split('/')?.[0] === config.repositoryOwner;
const httpOptions: InternalHttpOptions = {
// Only cache response if it's from the same repo
repoCache: repo === config.repository,
// Only cache response if it's from the same org
repoCache: isSameOrg,
};
let url = `repos/${repo}/contents/${fileName}`;
if (branchOrTag) {
Expand Down

0 comments on commit 22723cf

Please sign in to comment.