Fix Action fails if saving cache fails #53 by s-weigand · Pull Request #54 · pre-commit/action

Conversation

@s-weigand

This should fix #53, but as said before, the problem itself is most likely due to corruped cache, which makes testing it quite hard.
Wrapped saving cache in try-catch block, so the action itself shouldn't fail, if the caching fails.

@asottile

one change per patch please, some parts of this are acceptable others are not -- I'm also planning to scrap/rewrite this at some point so I'm not sure if changing it now is a good idea

@s-weigand

@asottile

Ok sure, does keeping 470aac6 and ec0d6c4 sound reasonable to you?

yep seems fine, want to split those out?

@s-weigand

asottile

@dhimmel

Have been getting Error: reserveCache failed: Cache already exists somewhat frequently, so thanks for this PR. Just wanted to check in, since would be great to avoid failing tests from non-essential caching.

@s-weigand

Didn't have that error again and forgot this PR 😅
From my side, it is ready if @asottile is fine with it.

@asottile

the comments aren't addressed

@s-weigand

asottile

asottile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.