Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDockerConfigJson(): Return empty auth when ~/.docker/config.json doesn't exist #39

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

PhrozenByte
Copy link
Contributor

@PhrozenByte PhrozenByte commented Dec 16, 2023

Description

Fixes getDockerConfigJson() raising an ENOENT 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

  • This PR includes a documentation change
  • This PR does not need a documentation change

  • This PR includes test changes
  • This PR's changes are already tested
  • What tests?

  • This change is not user-facing
  • This change is a patch change
  • This change is a minor change
  • This change is a major (breaking) change

Changes made

@github-actions github-actions bot added the CRDA Scan Pending CRDA scan waiting for approval label Dec 16, 2023
@divyansh42 divyansh42 merged commit bcf6f9c into redhat-actions:main Mar 16, 2024
8 checks passed
PhrozenByte added a commit to PhrozenByte/podman-login-workflow that referenced this pull request Aug 7, 2024
PhrozenByte added a commit to PhrozenByte/podman-login-workflow that referenced this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CRDA Scan Pending CRDA scan waiting for approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Auth file not created after successful login
2 participants