-
I have read about the update that the GitHub Actions Cache size is limited to 10GB. How does the GitHub Actions Cache size limit work for Pull Requests? Is the quota for the cache size limit per-user repository (forked repository, where the pull request branch is contained) or for the repository where the pull request is created? Because of security reasons, a pull request build cannot update the upstream repository’s GitHub Action cache. When the cache gets updated, I would assume that the cache gets stored in the cache associated with the user’s branch and forked repository and thus consumes the quota of the forked repository instead of the upstream repository quota. Is this the correct understanding? It would be great to have an explanation in the cache documentation at Caching dependencies to speed up workflows - GitHub Docs . |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I found some discussion about the behavior of GitHub Actions Cache with Pull Requests in Same cache key not shared between different pull requests · Issue #79 · actions/cache · GitHub . However, there’s no answer to my question there. |
Beta Was this translation helpful? Give feedback.
-
@dhadka How does the GitHub Actions Cache size limit work for Pull Requests? Would you be able to answer this question? Is the quota of the forked repository used or does it consume the quota of the upstream repository where the Pull Requests is created? |
Beta Was this translation helpful? Give feedback.
-
I also found this issue report: Pull-Requests evicting cache from master · Issue #534 · actions/cache · GitHub . |
Beta Was this translation helpful? Give feedback.
-
I asked the same question in actions/cache discussion: How does the GitHub Actions Cache size limit work for Pull Requests? · Discussion #776 · actions/cache · GitHub |
Beta Was this translation helpful? Give feedback.
-
It will write to the cache in whichever repo is running the workflow. To see which it is, find which repo (fork or upstream) that has the run in the Actions tab. Here’s what I saw with some testing:
In case there are concerns about case #2, note that a maintainer in the upstream repo must first approve the PR before the workflow will run - Approving workflow runs from public forks - GitHub Docs. |
Beta Was this translation helpful? Give feedback.
It will write to the cache in whichever repo is running the workflow. To see which it is, find which repo (fork or upstream) that has the run in the Actions tab. Here’s what I saw with some testing:
If you make changes within a fork (e.g., a PR merging from
myfork:mybranch
→myfork:main
), the Action runs within the fork and the cache says within the fork.If you send a PR to the upstream repo (e.g.,
myfork:mybranch
→upstream:main
), then the Action runs within the upstream repo and consequently the cache is created within the upstream repo.In case there are concerns about case #2, note that a maintainer in the upstream repo must first approve the PR before the workflow will run - A…