[WIP] Workflows

This commit is contained in:
2026-02-27 16:34:17 -06:00
parent 570c52e623
commit daeff10f18
96 changed files with 5889 additions and 2098 deletions

View File

@@ -1,17 +1,58 @@
#!/bin/bash
#!/bin/sh
# List Example Action
# Demonstrates JSON Lines output format for streaming results
#
# This script uses pure POSIX shell without external dependencies like jq.
# It reads parameters in DOTENV format from stdin until the delimiter.
set -euo pipefail
set -e
# Read parameters from stdin (JSON format)
read -r params_json
# Initialize count with default
count=5
# Extract count parameter (default to 5 if not provided)
count=$(echo "$params_json" | jq -r '.count // 5')
# Read DOTENV-formatted parameters from stdin until delimiter
while IFS= read -r line; do
case "$line" in
*"---ATTUNE_PARAMS_END---"*)
break
;;
count=*)
# Extract value after count=
count="${line#count=}"
# Remove quotes if present (both single and double)
case "$count" in
\"*\")
count="${count#\"}"
count="${count%\"}"
;;
\'*\')
count="${count#\'}"
count="${count%\'}"
;;
esac
;;
esac
done
# Validate count is a positive integer
case "$count" in
''|*[!0-9]*)
count=5
;;
esac
if [ "$count" -lt 1 ]; then
count=1
elif [ "$count" -gt 100 ]; then
count=100
fi
# Generate JSON Lines output (one JSON object per line)
for i in $(seq 1 "$count"); do
i=1
while [ "$i" -le "$count" ]; do
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "{\"id\": $i, \"value\": \"item_$i\", \"timestamp\": \"$timestamp\"}"
printf '{"id": %d, "value": "item_%d", "timestamp": "%s"}\n' "$i" "$i" "$timestamp"
i=$((i + 1))
done
exit 0