Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/pr-review-panel.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .github/workflows/shared/apm.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,26 @@ jobs:
apps_json=${AW_APM_APPS:-null}
legacy_id=${AW_APM_LEGACY_APP_ID:-}

# gh-aw substitutes `${{ github.aw.import-inputs.packages }}` at
# compile time using Go's default slice formatter, which emits
# `[a b c]` (space-separated, no quotes) instead of valid JSON.
# That breaks `jq --argjson` below. Repair string-array inputs
# in place; leave already-valid JSON untouched. apps[] (objects)
# is not repairable this way -- consumers must use the legacy
# single-app inputs until upstream gh-aw exposes a JSON-encoding
# helper for import-inputs.
repair_string_array() {
local raw="$1"
if [ -z "$raw" ] || [ "$raw" = "null" ]; then
echo "$raw"; return
fi
if printf '%s' "$raw" | jq -e 'type=="array"' >/dev/null 2>&1; then
echo "$raw"; return
fi
python3 -c 'import json, re, sys; s=sys.argv[1].strip(); s=s[1:-1] if s.startswith("[") and s.endswith("]") else s; print(json.dumps([t for t in re.split(r"[\s,]+", s) if t]))' "$raw"
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repair_string_array introduces a new runtime dependency on python3, but this job already assumes only bash + jq. On runs-on: ubuntu-slim it's not guaranteed python3 is present, so this can break the workflow even when jq is available. Prefer implementing the repair using jq (already required) or add an explicit command -v python3 check with a clear error (and then recompile the lock workflows).

Suggested change
python3 -c 'import json, re, sys; s=sys.argv[1].strip(); s=s[1:-1] if s.startswith("[") and s.endswith("]") else s; print(json.dumps([t for t in re.split(r"[\s,]+", s) if t]))' "$raw"
printf '%s' "$raw" | jq -Rn '
input
| gsub("^\\s+|\\s+$"; "")
| if startswith("[") and endswith("]") then .[1:-1] else . end
| split("[\\s,]+"; null)
| map(select(length > 0))
'

Copilot uses AI. Check for mistakes.
}
packages_json=$(repair_string_array "$packages_json")

groups=$(jq -nc \
--argjson packages "$packages_json" \
--argjson apps "$apps_json" \
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/triage-panel.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading