File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,20 @@ async function main() {
5454 const restored = await cache . restoreCache ( cachePaths , cacheKey ) ;
5555 const ret = await exec . exec ( 'pre-commit' , args , { ignoreReturnCode : push } ) ;
5656 if ( ! restored ) {
57- await cache . saveCache ( cachePaths , cacheKey ) ;
57+ try {
58+ await cache . saveCache ( cachePaths , cacheKey ) ;
59+ } catch ( e ) {
60+ core . warning (
61+ [
62+ "There was an error saving the pre-commit environments to cache:\n\n" ,
63+ `${ e . message } \n\n` ,
64+ "This only has performance implications and won't change the result of your pre-commit tests.\n" ,
65+ "If this problem persists on your default branch, you can try to fix it by editing your '.pre-commit-config.yaml'. " ,
66+ "I.e. run 'pre-commit autoupdate' or simply add a blank line. " ,
67+ "This will result in a different hash value and thus a different cache target." ,
68+ ] . join ( "" )
69+ ) ;
70+ }
5871 }
5972
6073 if ( ret && push ) {
You can’t perform that action at this time.
0 commit comments