File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,10 @@ jobs:
73
73
run : |
74
74
JSON_OUTPUT=$(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry-run=json)
75
75
76
-
76
+
77
77
# Use node -p to parse the JSON *string* and extract the status
78
78
# Note the use of JSON.parse() and backticks (`) for the string literal
79
- TURBO_CACHE_STATUS=$(node -p "JSON.parse(\`$JSON_OUTPUT\`).tasks.find(t => t.task === $("build:android")).cache.status")
80
-
79
+ TURBO_CACHE_STATUS=$(echo "$JSON_OUTPUT" | jq -r '.tasks[] | select(.task == "build:android") | .cache.status // "MISS"')
81
80
82
81
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
83
82
echo "turbo_cache_hit=1" >> $GITHUB_ENV
@@ -138,7 +137,7 @@ jobs:
138
137
139
138
# Use node -p to parse the JSON *string* and extract the status
140
139
# Note the use of JSON.parse() and backticks (`) for the string literal
141
- TURBO_CACHE_STATUS=$(node -p "JSON.parse(\` $JSON_OUTPUT\`) .tasks.find(t => t .task === $( "build:ios")) .cache.status" )
140
+ TURBO_CACHE_STATUS=$(echo " $JSON_OUTPUT" | jq -r ' .tasks[] | select( .task == "build:ios") | .cache.status // "MISS"' )
142
141
143
142
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
144
143
echo "turbo_cache_hit=1" >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments