solvaholic / octodns-sync

GitHub Action to test and deploy DNS settings with OctoDNS
MIT License
28 stars 14 forks source link

Custom working-directory support #101

Closed hit0ri closed 11 months ago

hit0ri commented 1 year ago

Detailed Description

Could you please add support for custom working-directory?

Context

We keep our octodns in a dns subdirectory and not in the root of repository. In our case this action fails with FileNotFoundError: [Errno 2] No such file or directory: 'config/prod.yaml' as it's running in the github.workspace.

Possible Implementation

Your Environment

solvaholic commented 1 year ago

Thank you for raising this and #102 @hit0ri! 🙇

We keep our octodns in a dns subdirectory and not in the root of repository.

I have in mind it should suffice to include dns in config_path, for example:

    config_path: dns/config/prod.yaml

Is that how you set config_path, when you received the FileNotFoundError?

hit0ri commented 1 year ago

I got FileNotFoundError when I was trying to set working-directory with jobs.<job_id>.defaults.run which as it turned out doesn't work for actions. When I include dns in config_path it fails with the following error:

FileNotFoundError: [Errno 2] No such file or directory: './env/prod/<ZONE>.yaml'

If I include dns for directory configuration option of yaml provider it actually works but I can no longer run it locally from dns directory which I guess is a fair trade-off. Not sure why I didn't try it earlier and I think you can close this and a #102.

solvaholic commented 1 year ago

Thank you for following up on this @hit0ri. I'm glad you found a way, at least, to un-block octodns-sync.

I remember thinking, when I first tried using it, octodns made some surprising assumptions about where to find the per-zone .yaml files. I'd like to find or set up a demo/test to explore the current behavior, and look for ways to prevent interruptions like you experienced using this action.