Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install action does not honor working-directory #83

Open
mdobosz-isp opened this issue Jul 30, 2020 · 6 comments · May be fixed by #326
Open

Install action does not honor working-directory #83

mdobosz-isp opened this issue Jul 30, 2020 · 6 comments · May be fixed by #326
Labels
enhancement New feature or request

Comments

@mdobosz-isp
Copy link

The install action does not appear to honor the working-directory configured in a workflow.

In this repro project 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 and master 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.

@smorimoto
Copy link
Member

​This is also a good idea. ​Would you like to tackle this?

@smorimoto smorimoto added the enhancement New feature or request label Nov 13, 2020
@marcind
Copy link

marcind commented Nov 17, 2020

Sorry, I've moved on to working on something else and probably won't have enough spare time to tackle this.

@smorimoto
Copy link
Member

Got it, that's okay.

@afirth afirth linked a pull request Jun 17, 2021 that will close this issue
@claywd-x
Copy link

claywd-x commented Sep 5, 2021

Ran into this today too. When looking at the raw logs I don't even understand how to get it to install the .tool-versions

First step list the files in the working-directory while the next step tries to install asdf and fails because it defaults to /usr/bin/git ?

2021-09-05T23:16:41.1760059Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2021-09-05T23:16:41.1760582Z ##[endgroup]
2021-09-05T23:16:41.1857137Z .
2021-09-05T23:16:41.1857949Z ..
2021-09-05T23:16:41.1859055Z .tool-versions
2021-09-05T23:16:41.1859601Z backend.tf
2021-09-05T23:16:41.1860202Z common.auto.tfvars
2021-09-05T23:16:41.1860830Z local.tf
2021-09-05T23:16:41.1861472Z output.tf
2021-09-05T23:16:41.1862004Z provider.tf
2021-09-05T23:16:41.1862540Z redirect.tf
2021-09-05T23:16:41.1863102Z variables.tf
2021-09-05T23:16:41.1863692Z versions.tf
2021-09-05T23:16:41.1864182Z zones.tf
2021-09-05T23:16:41.1920853Z ##[group]Run asdf-vm/actions/install@v1
2021-09-05T23:16:41.1921329Z with:
2021-09-05T23:16:41.1921794Z   asdf_branch: master
2021-09-05T23:16:41.1922201Z ##[endgroup]
2021-09-05T23:16:41.5451373Z Cloning asdf into ASDF_DIR: /home/runner/.asdf
2021-09-05T23:16:41.5464765Z [command]/usr/bin/git clone --depth 1 --branch master https://github.com/asdf-vm/asdf.git /home/runner/.asdf
2021-09-05T23:16:41.5466239Z Cloning into '/home/runner/.asdf'...
2021-09-05T23:16:41.5472876Z ##[error]Action failed with error Error: ENOENT: no such file or directory, open '.tool-versions'
2021-09-05T23:16:41.5579448Z Post job cleanup.

@joetynan
Copy link

You know, I just ran into this today as well. I don't suppose there's something on the roadmap to address this? Really, if I could specify a path to the .tool-versions file, that would suffice.

@tvdu29
Copy link

tvdu29 commented Dec 4, 2023

hey 👋
we are looking to implement asdf in a large monorepo for terraform version management.
being abe to specify which .tool-versions file would be a great plus :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants