From fdaf1b9ceee89ce999931d41d75fc991f5ff4079 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 14:28:17 +0000 Subject: [PATCH 1/3] build(workflows): guard `process_metadata` against a null `.type` field The job `Process Metadata` (issue_comment trigger) failed on develop with `jq: error ... null (null) and string ("workflow_d...) cannot have their containment checked`, exit code 5. Root cause: the "Check metadata for workflow dispatch directives" step runs `jq -c '.[] | select(.type | contains("workflow_dispatch"))'` against the output of `stdlib-js/metadata-action`. When that action cannot extract a recognized metadata block from a plain PR comment, it emits an entry with no `type` key at all, so `.type` is `null`, and piping `null` into `contains()` is a jq type error rather than a non-match. Since this workflow runs on every `issue_comment` event from a write-access user, an ordinary comment reliably reproduces this. This commit null-coalesces `.type` to an empty string before the `contains` check, so a missing/null type is treated as a non-match instead of crashing the step, while preserving the existing matching behavior for entries that do carry a `type`. Ref: https://github.com/stdlib-js/stdlib/actions/runs/36308648844 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz --- .github/workflows/process_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/process_metadata.yml b/.github/workflows/process_metadata.yml index 5117c9e5a67a..109fa06e15c4 100644 --- a/.github/workflows/process_metadata.yml +++ b/.github/workflows/process_metadata.yml @@ -117,7 +117,7 @@ jobs: env: METADATA: ${{ steps.extract-metadata.outputs.metadata }} run: | - inputs=$(echo "$METADATA" | jq -c '.[] | select(.type | contains("workflow_dispatch"))') + inputs=$(echo "$METADATA" | jq -c '.[] | select((.type // "") | contains("workflow_dispatch"))') if [ -n "$inputs" ]; then name=$(echo $inputs | jq -r '.name') inputs=$(echo $inputs | jq -c 'del(.type, .name, .author, .id, .url) | map_values(tostring)') From 9c8519077d1e411171d2c8d58f19d0028b26a2be Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 22:11:22 +0000 Subject: [PATCH 2/3] docs(workflows): explain the `.type // ""` guard in `process_metadata` Adds a comment explaining why the null-coalesce is needed, per @kgryte's review request. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz --- .github/workflows/process_metadata.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/process_metadata.yml b/.github/workflows/process_metadata.yml index 109fa06e15c4..9121715b0ba9 100644 --- a/.github/workflows/process_metadata.yml +++ b/.github/workflows/process_metadata.yml @@ -117,6 +117,7 @@ jobs: env: METADATA: ${{ steps.extract-metadata.outputs.metadata }} run: | + # Note: a metadata entry may have no `type` field (e.g., when `stdlib-js/metadata-action` cannot extract a recognized metadata block from a comment), in which case `.type` is `null`; `// ""` substitutes an empty string so `contains` sees a non-matching value instead of raising a `null`-input error: inputs=$(echo "$METADATA" | jq -c '.[] | select((.type // "") | contains("workflow_dispatch"))') if [ -n "$inputs" ]; then name=$(echo $inputs | jq -r '.name') From 5b11ae98896f31b6afa849529400a6329bba0f6b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 22:13:49 +0000 Subject: [PATCH 3/3] build(workflows): revert explanatory comment in `process_metadata` @kgryte's request was for an explanation of the change, not a code comment; the explanation was given inline on the PR instead. Reverts to the one-line fix. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz --- .github/workflows/process_metadata.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/process_metadata.yml b/.github/workflows/process_metadata.yml index 9121715b0ba9..109fa06e15c4 100644 --- a/.github/workflows/process_metadata.yml +++ b/.github/workflows/process_metadata.yml @@ -117,7 +117,6 @@ jobs: env: METADATA: ${{ steps.extract-metadata.outputs.metadata }} run: | - # Note: a metadata entry may have no `type` field (e.g., when `stdlib-js/metadata-action` cannot extract a recognized metadata block from a comment), in which case `.type` is `null`; `// ""` substitutes an empty string so `contains` sees a non-matching value instead of raising a `null`-input error: inputs=$(echo "$METADATA" | jq -c '.[] | select((.type // "") | contains("workflow_dispatch"))') if [ -n "$inputs" ]; then name=$(echo $inputs | jq -r '.name')