fix: add support for environments without remote cache#91
Merged
Conversation
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 17, 2021
## [5.5.0](5.4.0...5.5.0) (2021-06-17) ### New features * switch to node 14 for the action itself ([f13b0ea](f13b0ea)) ### Bug fixes * add support for environments without remote cache ([#91](#91)) ([9c0e696](9c0e696)) ### Code changes * simplify typescript config with community config ([#94](#94)) ([da4e754](da4e754)) * update all dependencies to latest versions ([#93](#93)) ([6bc0bed](6bc0bed)) ### Other chores * add semantic release for easy versioning ([#95](#95)) ([6354b0a](6354b0a)) * fix the allowed branches for semenatic release ([6b8c488](6b8c488)) * mock the github actions warning to avoid leaking annotations ([#96](#96)) ([a11a47a](a11a47a)) * tweak the release workflow ([79ebfbc](79ebfbc)) ### Documentation changes * add missing release step to contributing guide ([04e3b32](04e3b32))
|
🎉 This PR is included in version 5.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Testing your workflow in Github actions might not be the best DX. Having this action work with nektos/act would be great to have.
fixes #90
The change
I was looking at detecting if the action is running in the
actenvironment, by checking if theACTenvironment variable is set. But, I assume the cache might not always be available, like on custom runners or enterprise Github users. Instead of checking on theACTenv var, I opted to go for improved error handling.Right now it checks on these two errors:
ReserveCacheErrorCache Service Url not found.Additional context
Adding error handling is tricky, we should never obfuscate the actual error. That's why I kept the error report in two lines:
Another thing I noticed is if you forgot to add the secret, and Expo requires to authenticate, it fails to recognize the CLI is running in non-interactive mode. I think that might be an error in act, if you run into this you have to manually force close docker/cli.
How to use it
I've run this change locally on bycedric/office-marathon using the smallest Docker instance from act. That seems to work fine!
That should produce this output: