digitalocean / digitalocean/action-doctl
`doctl auth init` fails with "Config initialization failed: yaml parsing error" on self-hosted runners with existing config
- Dominant language
- JavaScript
- Stars
- 520
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
## Description
`doctl auth init` fails during the action's authentication step when a pre-existing `doctl` config file is present on a self-hosted
runner.
## Error
doctl: 2026/06/18 09:28:50 Config initialization failed: While parsing config: yaml: line 2290: could not find expected ':'
Error: The process '.../doctl' failed with exit code 1
## Environment
- Runner: self-hosted (Linux x64)
- doctl version: 1.162.0 (installed by the action, `version: latest`)
- Action version: v2
## Steps to Reproduce
1. Use a self-hosted runner with a pre-existing `~/.config/doctl/config.yaml` (accumulated from previous runs/kubeconfig saves)
2. Run `digitalocean/action-doctl@v2` with a valid token
3. `doctl auth init` fails trying to parse the existing config
## Expected Behavior
`doctl auth init -t ` should initialize auth regardless of the state of the existing config file, or the action should clear/ignore
the existing config before initializing.
## Workaround
Deleting or truncating the existing config file before the action runs:
```yaml
- name: Clear doctl config
run: rm -rf ~/.config/doctl
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
```
> **Edit**: he initial workaround (`rm -f ~/.config/doctl/config.yaml`) doesn't work because `doctl auth init` re-creates the file in the same directory, inheriting the corrupted state. The correct workaround is to remove the entire directory so `doctl` recreates it from scratch.
Suggestion
The action could either:
1. Set XDG_CONFIG_HOME to a temp directory to isolate each run
2. Delete the existing config before doctl auth init
3. Use --config flag to point to a fresh file
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the action's authentication entry point that runs `doctl auth init` and review how `~/.config/doctl` is handled before invoking `digitalocean/action-doctl@v2`. Reproduce with an existing corrupted config on a self-hosted Linux runner, then verify that authentication succeeds without inheriting the prior config and that the existing workaround remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, javascript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100