feat: add format option to workspace.list#12
Conversation
|
Thanks @ilyichv, |
|
Of course! What do you think of |
|
I prefer the
|
|
Yeah, i'd say also that we can remove --json and in general what concern saving files. Once you have a formatted json you can just
|
|
Pipe is not guaranteed to yield a valid json file, if something needs to be compiled first it will also include the compilation output. |
|
Agreed, i'll proceed as you suggested then! |
|
@pnezis Done! I soft-deprecated |
We're building a pipeline that leverages on affected packages. - name: Detect changes
id: changes
run: |
mix workspace.list --show-status --json --tag scope:app --base "HEAD" --head "HEAD~1"
echo "workspace.json: $(cat workspace.json)"
CHANGED_APPS=$(jq -c '[.projects[] | select(.status == "affected" or .status == "modified") | .app]' workspace.json)
echo "changed-apps=$CHANGED_APPS" >> $GITHUB_OUTPUTSince we fixed Besides that I was about to open a discussion in this repo but we may chat on X. In any case having a convo about that would be great! |
|
Thanks for the explanation, makes sense.
Glad to discuss about it (both X or here is fine) |
I just texted you on X! |
Add
--formatoption toworkspace.list. It can be set to:pretty(default) - retains the current behaviorjson- outputs the following format:{ "projects": { "count": 1, "projects": [ { "app": "core", "path": "packages/core" } ] }, "workspace_path": "/Users/user/Workspace/myworkspace" }This feature was inspired by Turborepo’s approach, and in my opinion, it can take this library a step further toward being more useful in CI environments.