Skip to content

Commit 357c7ee

Browse files
committed
Remove jq dependency from get_plugin_slug.sh
Replaces the use of jq for generating a JSON array of valid plugins with a pure Bash implementation. This improves portability and removes the need for jq in the script's environment.
1 parent 48279b4 commit 357c7ee

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/scripts/get_plugin_slug.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ done
4141

4242
# Output all valid plugins as JSON array for matrix strategy
4343
if [ ${#VALID_PLUGINS[@]} -gt 0 ]; then
44-
PLUGINS_JSON=$(printf '%s\n' "${VALID_PLUGINS[@]}" | jq -R . | jq -s .)
44+
# Simple, reliable JSON array generation
45+
PLUGINS_JSON="["
46+
for i in "${!VALID_PLUGINS[@]}"; do
47+
if [ $i -eq 0 ]; then
48+
PLUGINS_JSON="$PLUGINS_JSON\"${VALID_PLUGINS[i]}\""
49+
else
50+
PLUGINS_JSON="$PLUGINS_JSON,\"${VALID_PLUGINS[i]}\""
51+
fi
52+
done
53+
PLUGINS_JSON="$PLUGINS_JSON]"
54+
4555
echo "plugins=$PLUGINS_JSON" >> "$GITHUB_OUTPUT"
4656
echo "has-plugins=true" >> "$GITHUB_OUTPUT"
4757

0 commit comments

Comments
 (0)