hashFiles fails silently when it encounters a broken symlink
See original GitHub issueDescribe the bug
When the pattern passed to hashFiles()
matches a broken symlink (a symlink that points to a non-existent file), hashFiles()
silently fails and produces an empty hash. Example: https://github.com/formsort/formsort/runs/5096669434?check_suite_focus=true#step:4:139
To Reproduce Steps to reproduce the behavior:
- Create a repo
- Add a symlink to a non-existent file
ln -s bla bla
- Create a workflow that uses
hashFiles("**")
in it - Observe that the output of
hashFiles("**")
is empty witout any errors - Now enable step debug logging: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
- Re-run the action
- Observe the unhandled promise rejection error, silently being swallowed:
##[debug](node:1536) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/runner/work/[redacted]'
Expected behavior
hashFiles
should either skip over broken symlinks or fail the whole job loudly, clearly indicating the error.
Runner Version and Platform
Version of your runner?
GitHub-hosted Ubuntu 20.04
Job Log Output
##[debug](node:1536) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/runner/work/[redacted]'
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Symlink broken right after creation
create a symlink called TARGET which is symbolically linked to the string SOURCE . If SOURCE is a relative path (that is, it...
Read more >Why does ln -sf silently fail? - symlink
ln -f without -s must of course fail because you're asking it to increase the ref count on a non-existent inode. – Joseph...
Read more >Fixing Broken Symlinks With Find and Replace - Techbit
The Problem. If a symlink is pointing at a file and the path changes (say a folder was renamed), the symlink is then...
Read more >ftp.porcupine.org/mirrors/postfix-release/official...
Bugfix: the smtp server command tokenizer silently discarded the [] around [text], ... Cleanup: after "postfix reload", no more broken pipe complaints from ......
Read more >man page dar section 1
COMMANDS: Only seven commands define what action will be done by dar: Archive creation, archive extraction, archive listing, archive testing, archive comparison ...
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
Hi @BYK,
I reproduced the issue. Working on the fix so you don’t have to bother creating an example repository 😊.
Hi @BYK, don’t worry about it 😊. Your issue description was good enough! I submitted a PR fixing this issue