actions icon indicating copy to clipboard operation
actions copied to clipboard

plugins-add action does not walk up directory structure to discover all possible plugins

Open mdobosz-isp opened this issue 5 years ago • 1 comments

The plugins-add action does not appear to walk up the directory structure to discover all possible plugins to install when a non-default working-directory is configured in a workflow.

In this repro project I set up, I have a .tool-versions file in the root that configures one tool: https://github.com/mdobosz-isp/asdf-actions-wrong-dir/blob/d448ef42593a21fef79927bd5e433f2f523b3888/.tool-versions#L1 I also have a subdirectory that sets a different tool: https://github.com/mdobosz-isp/asdf-actions-wrong-dir/blob/d448ef42593a21fef79927bd5e433f2f523b3888/terraform/.tool-versions#L1

When I execute a workflow that uses the non-default working directory: https://github.com/mdobosz-isp/asdf-actions-wrong-dir/blob/26d01bec1e7a7b48c5270acce978db41a4e2a3a4/.github/workflows/repro.yml#L8-L20 the plugin configured only in the subdirectory does not get installed which makes it impossible to correctly use the install action in that subdirectory (assuming https://github.com/asdf-vm/actions/issues/83 gets resolved) or to run asdf install as a freeform step.

This fails for workflows using the v1.0.0 and master versions of the action.

I would expect that the plugins-add action walked up the directory tree starting from working-directory and assembled the set of plugins to install from all .tool-versions files found.

The current workarounds are:

  1. Specify all possible tools and their default versions in the repos root .tool-versions file
  2. Run the plugins-add action multiple times for each directory that has a .tool-versions file, however this does not work on the v1 version of the action because https://github.com/asdf-vm/actions/pull/74 has not become part of an official release yet.

mdobosz-isp avatar Jul 30 '20 17:07 mdobosz-isp

​Implementing this makes a lot of sense if you want to use asdf in the CI workflow. ​I will try this, but I think it's a bit too much to recursively check all directories by default, so it would be better to disable it feature by default. What do you think?

smorimoto avatar Nov 13 '20 04:11 smorimoto