1
0
Fork 0

adds base and default ref for PR case

pull/1935/head
Prajjwal 2024-06-20 12:08:34 +05:30
parent 67fd4c73a6
commit cb3493c613
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "github-actions.warp-cache", "name": "github-actions.warp-cache",
"version": "1.2.0", "version": "1.2.1",
"preview": true, "preview": true,
"description": "Github action to use WarpBuild's in-house cache offering", "description": "Github action to use WarpBuild's in-house cache offering",
"keywords": [ "keywords": [

View File

@ -156,9 +156,18 @@ export async function getCacheEntry(
case 'pull_request': case 'pull_request':
{ {
const pullPayload = github.context.payload as PullRequestEvent const pullPayload = github.context.payload as PullRequestEvent
// Adds PR head branch and base branch to restoreBranches
restoreBranches.push( restoreBranches.push(
`refs/heads/${pullPayload?.pull_request?.head?.ref}` `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 head points to a different repository, add it to restoreRepos. We allow restores from head repos as well.
if ( if (