intellikit icon indicating copy to clipboard operation
intellikit copied to clipboard

CI: `fromJson` fails due to shell quote stripping

Open coleramos425 opened this issue 8 months ago • 0 comments

Description

The test-installation job in intellikit-ci-test.yml fails with:

Error when evaluating 'strategy' for job 'test-installation'.
.github/workflows/intellikit-ci-test.yml (Line: 100, Col: 18):
Error from function 'fromJson': Unexpected symbol: 'kerncap'.
Located at line 1 position 2 within JSON.

This happens on pull requests that only change a subset of packages (i.e., when the else branch on line 63 is taken).

Root Cause

In the build-matrix step, the dorny/paths-filter changes output (a JSON array like ["kerncap","metrix"]) is interpolated directly into a double-quoted echo:

echo "packages=${{ steps.filter.outputs.changes }}" >> "$GITHUB_OUTPUT"

GitHub Actions expands this before the shell sees it, producing:

echo "packages=["kerncap","metrix"]" >> "$GITHUB_OUTPUT"

The shell merges the inner double quotes with the outer ones, writing [kerncap,metrix] (unquoted names) into GITHUB_OUTPUT. When fromJson parses this on line 100, it fails because it's not valid JSON.

The ALL path (line 62) is unaffected because it uses a shell variable set with single quotes ('["accordo",...]'), which preserves the JSON structure.

coleramos425 avatar Mar 30 '26 21:03 coleramos425