404 when including github.ref in key
See original GitHub issueWith config like this:
- name: Ubuntu cache
uses: actions/cache@preview
if: startsWith(matrix.os, 'ubuntu')
with:
path: ~/.cache/pip
key: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
- name: macOS cache
uses: actions/cache@preview
if: startsWith(matrix.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
It creates a key like "Test-refs/heads/gha-cache-ubuntu-18.04-3.5"
.
The upload step fails with a 404:
Post Ubuntu cache1s
##[warning]Cache service responded with 404
Post job cleanup.
/bin/tar -cz -f /home/runner/work/_temp/802beeb6-cc68-45cb-a68d-488cc4008df5/cache.tgz -C /home/runner/.cache/pip .
##[warning]Cache service responded with 404
eg. https://github.com/hugovk/Pillow/runs/286812478#step:22:1
That’s because github.ref
includes slashes (eg. refs/heads/gha-cache
):
The branch or tag ref that triggered the workflow. For example,
refs/heads/feature-branch-1
. If neither a branch or tag is available for the event type, the variable will not exist.
Should I escape or replace illegal characters (and how?) or should the Action take care of them?
Or is there another way to include the branch name in the key
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Troubleshooting - GitHub Docs
404 error for an existing repository. Typically, we send a 404 error when your client isn't properly authenticated. You might expect to see...
Read more >How to fix HTTP 404 on Github Pages? - Stack Overflow
I had just one commit with all my files. I pushed an empty commit, refreshed the page and it worked. git commit --allow-empty...
Read more >Adding a github SSH checkout key fails on API 1.1 with 404
Hello there! I have written a small npm module that will use the CircleCI API to add a checkout SSH key for the...
Read more >Git command returns "not found" or error code 404
When pulling from, pushing or cloning to Bitbucket Server, it responds with the error code 404. $ git push URL master fatal: URL/info/refs...
Read more >GitHub: a case study in link maintenance and 404 pages
I think they just break links for the fun of it. With GitHub, it's partially inherent (user content changes) and partially an artefact...
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
Yep, PRs are able to read from the cache of master (or default branch) but will write to the cache of the PR branch. We’re working on more comprehensive documentation.
@chancancode check out: https://help.github.com/en/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#cache-scope