mirror of https://github.com/actions/toolkit
adds base and default ref for PR case
parent
67fd4c73a6
commit
cb3493c613
|
@ -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": [
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
Loading…
Reference in New Issue