getDockerConfigJson(): Return empty auth when ~/.docker/config.json
doesn't exist
#39
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.
Description
Fixes
getDockerConfigJson()
raising anENOENT
error if~/.docker/config.json
doesn't exist (#18).This frequently happens with GitHub-hosted runners, but not always. I don't know why
~/.docker/config.json
sometimes doesn't exist, but it lets workflows fail pretty often - what is annoying.Some examples: (1), (2), (3) (note that the other parallel jobs succeeded...), (4), (5) (again, note the parallel job), (6) (more parallel...), (7) (again), (8) (and again) - all just within the last three days (unusually frequent though, normally it's once or twice a week or so...)
These changes are UNTESTED! Simply because I don't know how. I know a little JavaScript, but have next to zero experience with NodeJS (and honestly don't want to learn it), so please keep this in mind. I just figured that providing at least something to fix #18 is better than nothing.
The issue might be that not just
~/.docker/config.json
is missing, but the whole~/.docker
folder. If that's the case,fs.writeFile()
will fail here as well, requiring another fix. Since the issue isn't always reproducible it's hard to know... Fixing one issue first, trying whether the fix is complete and then possibly fix the other is probably easier than investing hours into debugging.Related Issue(s)
Fixes #18
Related to #36
Checklist
Changes made
getDockerConfigJson()
raising anENOENT
error if~/.docker/config.json
doesn't exist ([BUG] Auth file not created after successful login #18)