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

Allow providing custom path to .tool-versions file to look at #14

Closed
mkaput opened this issue Aug 24, 2023 · 2 comments
Closed

Allow providing custom path to .tool-versions file to look at #14

mkaput opened this issue Aug 24, 2023 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@mkaput
Copy link
Member

mkaput commented Aug 24, 2023

Problem

One of our users has a Scarb project in a submodule/subdirectory of the repository. This project contains a .tool-versions file that the user wants to use as reference point for version selection, but there is no way to instruct the action to look for this file elsewhere than the working directory.

Proposed Solution

Add a new input, named tool-versions, typed as an optional string. It will accept a path, absolute or relative to action's PWD, to the tool-versions file, that must exist. If provided, the action will always and only look for Scarb version in that provided path. No other deduction techniques will be applied, and inability to look for information should yield an error.

Example:

- uses: software-mansion/setup-scarb@v1
  with:
    tool-versions: ./my-submodule/.tool-versions

Notes

Most of the meat lies in this file: https://github.com/software-mansion/setup-scarb/blob/67ef98b555967b95dd7fc56ecdd1e93ce7cefdae/lib/versions.js. It is called from here:

setup-scarb/lib/main.js

Lines 15 to 22 in 67ef98b

const scarbVersionInput = core.getInput("scarb-version");
const { repo: scarbRepo, version: scarbVersion } = await determineVersion(
scarbVersionInput,
{
repo: "software-mansion/scarb",
nightliesRepo: "software-mansion/scarb-nightlies",
},
);

@mkaput mkaput added the good first issue Good for newcomers label Aug 24, 2023
@EvolveArt
Copy link
Contributor

I'm on it 🫡

@mkaput
Copy link
Member Author

mkaput commented Aug 24, 2023

Please don't forget about adding a test in our CI workflow, and also documenting this field in the readme 😃 Many thanks 😍

github-merge-queue bot pushed a commit that referenced this issue Aug 30, 2023
Solves #14

---------

Co-authored-by: Marek Kaput <marek.kaput@outlook.com>
@mkaput mkaput closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

No branches or pull requests

2 participants