Install action does not honor working-directory
- Dominant language
- JavaScript
- Stars
- 163
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
The install action does not appear to honor the working-directory 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 version of a tool:
https://github.com/mdobosz-isp/asdf-actions-wrong-dir/blob/d448ef42593a21fef79927bd5e433f2f523b3888/.tool-versions#L1
I also have a subdirectory that sets a different version of the tool:
https://github.com/mdobosz-isp/asdf-actions-wrong-dir/blob/d448ef42593a21fef79927bd5e433f2f523b3888/helm3/.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#L22-L34
the action still appears to run in the root working directory, resulting in the wrong version being installed and invocations of the tool failing when the asdf shim tries to load the correct version.
This fails for workflows using the [`v1.0.0`](https://github.com/mdobosz-isp/asdf-actions-wrong-dir/runs/928680635?check_suite_focus=true) and [`master`](https://github.com/mdobosz-isp/asdf-actions-wrong-dir/runs/928680596?check_suite_focus=true) versions of the action.
I would expect that the `asdf install` command was executed in the appropriate working directory.
The current workaround is to use the `plugins-add` action (which will also run `setup`) and run `asdf install` as a freeform step.
Contributor guide
Research direction
Start with the linked repro workflow at .github/workflows/repro.yml and compare its working-directory with the root and helm3/.tool-versions files. Reproduce the v1.0.0 or master behavior, trace where the install action runs asdf install, and confirm it uses the configured directory so the subdirectory's tool version is installed.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100