plugins-add action does not walk up directory structure to discover all possible plugins
- Dominant language
- JavaScript
- Stars
- 163
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/mdobosz-isp/asdf-actions-wrong-dir) 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`](https://github.com/mdobosz-isp/asdf-actions-wrong-dir/runs/928680550?check_suite_focus=true) and [`master`](https://github.com/mdobosz-isp/asdf-actions-wrong-dir/runs/928680427?check_suite_focus=true) 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.
Contributor guide
Research direction
Reproduce the issue with the linked repro project and its .github/workflows/repro.yml, using a non-default working-directory and .tool-versions files in both the repository root and subdirectory. Inspect the plugins-add action entry point; done means it discovers the parent directory files and installs the complete set of configured plugins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, javascript
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100