Skip to content

Add jq config query action#653

Closed
TylerJang27 wants to merge 6 commits into
mainfrom
tyler/jq
Closed

Add jq config query action#653
TylerJang27 wants to merge 6 commits into
mainfrom
tyler/jq

Conversation

@TylerJang27
Copy link
Copy Markdown
Collaborator

@TylerJang27 TylerJang27 commented Feb 7, 2024

A simple jq wrapper in order to query information about the Trunk Config. Only runs when config is valid (as expected). Running trunk run lookup .cli.version returns

"1.19.1-beta.11"

Similarly, the following returns a linter's definition

trunk run lookup '.lint.definitions[] | select(.name == "eslint")'

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Feb 7, 2024

⏱️ 14m total CI duration on this PR
Job Cumulative Duration Recent Runs
CodeQL-Build 6m 🟩🟩🟩🟩🟩
Trunk Check runner [linux] 4m 🟩🟩🟩🟩🟩
Repo Tests / Plugin Tests 2m 🟩🟩🟩🟩🟩
Action Tests 2m 🟥🟥🟥🟥🟩
Detect changed files 33s 🟩🟩🟩🟩🟩
Aggregate Test Results 14s 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@TylerJang27
Copy link
Copy Markdown
Collaborator Author

Nevermind, yq is strictly better for this. I'll make a tool definition for yq when I get the chance

@TylerJang27 TylerJang27 closed this Feb 7, 2024
@TylerJang27 TylerJang27 mentioned this pull request Feb 7, 2024
TylerJang27 added a commit that referenced this pull request Mar 21, 2024
Replaces #653. `yq` is the yaml equivalent of `jq`. Works really nicely
to print a lint definition using:
`trunk config print | .trunk/tools/yq '.lint.definitions[] |
select(.name == "eslint")'`, which could be streamlined via a Trunk
Action if desired once tools are supported in Actions.
@TylerJang27 TylerJang27 deleted the tyler/jq branch March 27, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant