diff --git a/packages/warp-cache/package.json b/packages/warp-cache/package.json index b1d0e9e4..7b27bae7 100644 --- a/packages/warp-cache/package.json +++ b/packages/warp-cache/package.json @@ -1,6 +1,6 @@ { "name": "github-actions.warp-cache", - "version": "1.2.0", + "version": "1.2.1", "preview": true, "description": "Github action to use WarpBuild's in-house cache offering", "keywords": [ diff --git a/packages/warp-cache/src/internal/cacheHttpClient.ts b/packages/warp-cache/src/internal/cacheHttpClient.ts index 818715a6..482e7c0e 100644 --- a/packages/warp-cache/src/internal/cacheHttpClient.ts +++ b/packages/warp-cache/src/internal/cacheHttpClient.ts @@ -156,9 +156,18 @@ export async function getCacheEntry( case 'pull_request': { const pullPayload = github.context.payload as PullRequestEvent + // Adds PR head branch and base branch to restoreBranches restoreBranches.push( `refs/heads/${pullPayload?.pull_request?.head?.ref}` ) + restoreBranches.push( + `refs/heads/${pullPayload?.pull_request?.base?.ref}` + ) + + // Adds default branch to restoreBranches + restoreBranches.push( + `refs/heads/${pullPayload?.repository?.default_branch}` + ) // If head points to a different repository, add it to restoreRepos. We allow restores from head repos as well. if (