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

Get version of specific package in aqua.yaml config #3464

Closed
SanderKnape opened this issue Jan 21, 2025 · 2 comments
Closed

Get version of specific package in aqua.yaml config #3464

SanderKnape opened this issue Jan 21, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@SanderKnape
Copy link

Feature Overview

I'm looking for an easy way to get a configured version in the aqua.yaml for a specific package.

Why is the feature needed?

In some cases I don't want to use Aqua to install a package, but I'd like to treat the aqua.yaml as the "single source of truth" for which package versions I want installed.

More specifically: I'm using tflint in GitHub Actions and I want to use the setup-tflint action for installing tflint (instead of aqua) as that action also sets up the problem matcher. I do want to use the version configured in the aqua.yaml so that we use the same version locally.

Right now the following works, but it's not great:

- run: echo "TFLINT_VERSION=$(yq '.packages[] | select(.name | contains("tflint")) | .name | split("@")[1]' aqua.yaml)" >> $GITHUB_ENV
- uses: terraform-linters/setup-tflint@v4
  with:
    tflint_version: ${{ env.TFLINT_VERSION }}

Example Code

There's a few ways this could be implemented.

$ aqua list -installed --format json
{
  "terraform-linters/tflint": "v0.55.0"
}

Add a (global) config option to return JSON to make it easier to grab the version.

Or add a more specific command that outputs the version.

Note

No response

@SanderKnape SanderKnape added the enhancement New feature or request label Jan 21, 2025
@suzuki-shunsuke
Copy link
Member

How about this?

$ aqua which -v tflint
v0.55.0

@SanderKnape
Copy link
Author

It totally didn't occur to me to look at the which subcommand considering its description. Maybe a small addition to the description would make sense?

Thanks for the quick reply! This is great.

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

No branches or pull requests

2 participants