Debug logs show hashFiles generates a hash; hash gets truncated when actually saving
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to cache a file with the following step:
- name: Cache machine stats
id: cache-stats
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/data/stats.json
key: hist-stats-${{ hashFiles('**/data/stats.json') }}
I already ran the checkout action, the file exists, and when I run the action with the debug option on, the logs show that the file name should be: hist-stats-b97af91963eaed082bd76ddcb2e2eb7dd314fc74b1a09bc908365a0053c00b5d. However, when the cache is finally uploaded, it says Cache saved with key: hist-stats- (no hash), and when I check the caches, only hist-stats- appears. I can't for the life of me figure out why this would be and would appreciate any pointers.
You can see the PR/code that is triggering the action here: https://github.com/ufs-community/ufs-weather-model/pull/2924
I'm sorry if the issue is due to something obvious--I'm rather new to this, and I'm not seeing anything online that helps/applies to my situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the workflow step in the issue body and compare the debug log's generated key with the cache upload message. Review the linked PR #2924 and the provided GitHub Actions run to trace where the hash is lost. Done means the cause is identified and a regression check or documented reproduction confirms the saved cache key includes the expected hash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100