hashFiles() does not work for valid patterns
See original GitHub issueThe expected behavior is that all three of the following steps pass on all platforms:
- name: Cache **/README.md
uses: actions/cache@preview
with:
path: .
key: test-${{ runner.os }}-${{ hashFiles('**/README.md') }}
continue-on-error: true
- name: Cache README.md
uses: actions/cache@preview
with:
path: .
key: test-${{ runner.os }}-${{ hashFiles('README.md') }}
continue-on-error: true
- name: Cache *README.md
uses: actions/cache@preview
with:
path: .
key: test-${{ runner.os }}-${{ hashFiles('*README.md') }}
continue-on-error: true
But right now hashFiles(README.md)
and hashFiles(*README.md)
fails macOS:
2019-11-02T18:08:19.8057240Z ##[error]The template is not valid. 'hashFiles(README.md)' failed. Search pattern 'README.md' doesn't match any file under '/Users/runner/runners/2.160.0/work/github-actions-hashfiles-test/github-actions-hashfiles-test'
2019-11-02T18:08:19.8346580Z ##[error]The template is not valid. 'hashFiles(*README.md)' failed. Search pattern '*README.md' doesn't match any file under '/Users/runner/runners/2.160.0/work/github-actions-hashfiles-test/github-actions-hashfiles-test'
And hashFiles(README.md)
and hashFiles(**/README.md)
fails Windows:
2019-11-02T18:09:01.2005576Z ##[error]The template is not valid. 'hashFiles(**/README.md)' failed. Search pattern '**/README.md' doesn't match any file under 'd:\a\github-actions-hashfiles-test\github-actions-hashfiles-test'
2019-11-02T18:09:01.2212553Z ##[error]The template is not valid. 'hashFiles(README.md)' failed. Search pattern 'README.md' doesn't match any file under 'd:\a\github-actions-hashfiles-test\github-actions-hashfiles-test'
See example repo: https://github.com/poiru/github-actions-hashfiles-test And run: https://github.com/poiru/github-actions-hashfiles-test/commit/23dcdc7705d1660ba845291f744dd9b4a9157458/checks?check_suite_id=293065410
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Post cache failed with "The template is not valid. hashFiles ...
Up to today, I am still having this error popping randomly (only on Mac OS machines), while Linux/Windows machines are working fine. image....
Read more >How do I cache steps in GitHub actions? - Stack Overflow
Any changes you make in one step persist on disk into the next steps for that workflow run. Of course, this will not...
Read more >7 Github Actions Tricks I Wish I Knew Before I Started
Here are 7 tricks with github actions that changed my life (or at least my CI/CD pipeline). These tricks helped me create a...
Read more >How to Verify Downloaded Files | DigitalOcean
You've probably downloaded some open-source software, ... Hashing a file doesn't encrypt the file and you can't take a checksum and run it ......
Read more >nFront-Password-Filter-Documentation.pdf
NOTE: Please report any problems with this document to feedback@nFrontSecurity.com. ... Reject passwords with a repeating pattern of X characters.
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
hashFiles
will be updated soon so that relative paths are rooted atgithub.workspace
, which will allowhashFiles('README.md')
./
not working on Windows is definitely a bug, ideally/
would work on all platforms so that you wouldn’t need arunner.separator
variable.@joshmgross The current
hashFiles
documentation states: “Returns a single hash for the set of files that matches the path pattern. The path is relative to the GITHUB_WORKSPACE directory […]” (as of 2019-11-09).However,
hashFiles('Gemfile.lock')
does not work at the moment. Documentation error or do I misunderstand something?