You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a workflow that runs on pull_request with types [opened, synchronize, reopened, closed]. I can see that when I push commits to my pull request it's able to restore the cache, however when the same workflow runs when I merge the pr (type=closed) It's not able to restore the existing cache and it's instead creating a new cache with the same key.
From the docs:
When a cache is created by a workflow run triggered on a pull request, the cache is created for the merge ref (refs/pull/.../merge). Because of this, the cache will have a limited scope and can only be restored by re-runs of the pull request. It cannot be restored by the base branch or other pull requests targeting that base branch.
Does the merging the same pull request not count as a re-run? Can you please clarify if this is expected behavior or not?
I see that in the cache UI it lists there are two caches with the same key. One has ref/pulls/{pr-number} while the other has the name of the base branch (which is not the default branch).
The text was updated successfully, but these errors were encountered:
I was able to get caching to work by using the pull_request_target instead of pull_request. My issue was the scoping of the caches that were created. When using pull_request the closed event would create the cache under the base branch while the opened, synchronize, reopened would create the cache under the pull request branch, so the closed event was not able to restore the cache created from the other events. After switching to pull_request_target all events create caches under the base branch which solved my issue.
I have a workflow that runs on pull_request with types
[opened, synchronize, reopened, closed]
. I can see that when I push commits to my pull request it's able to restore the cache, however when the same workflow runs when I merge the pr (type=closed) It's not able to restore the existing cache and it's instead creating a new cache with the same key.From the docs:
Does the merging the same pull request not count as a re-run? Can you please clarify if this is expected behavior or not?
I see that in the cache UI it lists there are two caches with the same key. One has ref/pulls/{pr-number} while the other has the name of the base branch (which is not the default branch).
The text was updated successfully, but these errors were encountered: