Wrong ref set for cache on release.type.published with explicit branch checkout
See original GitHub issueI have a workflow that is triggered on release
on:
release:
types: [published]
And I set ref to main branch explicitly for checkout action, because cache with tags’ refs are cannot be reused for feature branches, see #556 . Checking out for main branch is ok for me as it’s the same code version as the last release.
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
Anyway the cache is created with the tag ref
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token MY_TOKEN" \
https://api.github.com/repos/org/repo/actions/caches
{
"total_count": 5,
"actions_caches": [
{
"id": 8,
"ref": "refs/tags/<TAG>",
"key": "MY_KEY",
"version": "...",
"last_accessed_at": "2022-07-04T11:58:15.810000000Z",
"created_at": "2022-07-04T11:58:15.810000000Z",
"size_in_bytes": 76343
},
...
]
}
And for the feature branch the cache is not visible anyway:
Run actions/cache@v3
Cache not found for input keys: MY_KEY
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Cache dependencies and build outputs in GitHub Actions
cache. This action allows caching dependencies and build outputs to improve workflow execution time. In addition to this cache action, other two actions...
Read more >error: pathspec '...' did not match any file(s) known to git - Stack ...
I was getting this error when I tried to checkout new branch: error: pathspec 'BRANCH-NAME' did not match any file(s) known to git....
Read more >Trying GitHub Actions - Gleb Bahmutov
I have cloned actions/cache into cypress-io/github-actions-cache and have refactored the code in branch reusable-functions to allow using ...
Read more >GitHub Actions for .NET Core NuGet packages - Dusted Codes
In GitHub, under Settings and then Branches, one can set up branch ... and therefore the published type has to be specified explicitly....
Read more >7 Github Actions Tricks I Wish I Knew Before I Started
The workflow will trigger on every pull request to the main branch. Not only that, it will also trigger for any push to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The doc section is updated to call out the scope restrictions more clearly. Also added a sentence about tags scope.
Got it. It wouldn’t harm to mention this explicitly in the docs. Let me plan for that.