Repository navigation
build: guard against a null .type field - #15590
Merged
kgryte merged 3 commits intoSep 27, 2026
Merged
Conversation
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz
kgryte
reviewed
Sep 27, 2026
Adds a comment explaining why the null-coalesce is needed, per @kgryte's review request. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz
kgryte
reviewed
Sep 27, 2026
@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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz
kgryte
approved these changes
Sep 27, 2026
process_metadata against a null .type field.type field
kgryte
deleted the
philipp/ci-fix-process-metadata-jq-type-2026-09-27
branch
September 27, 2026 22:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
jqcrash in theprocess_metadataworkflow's "Check metadata for workflow dispatch directives" step.Failing run: https://github.com/stdlib-js/stdlib/actions/runs/36308648844 (
process_metadata/ "Process Metadata"), triggered by anissue_commentevent.The step fails with:
and exits 5.
The step runs
jq -c '.[] | select(.type | contains("workflow_dispatch"))'against metadata fromstdlib-js/metadata-action. When that action can't extract a recognized metadata block from an ordinary PR comment, it emits an entry with notypekey..typeevaluates tonull, and pipingnullintocontains()throws rather than evaluating to a non-match. This step runs on everyissue_comment(created/edited) from a write-access user, so any ordinary comment reproduces the failure.Fix: null-coalesce
.typebefore thecontainscheck —select((.type // "") | contains("workflow_dispatch")). Matching behavior for entries with a type is unchanged; a missing/null type is now a non-match instead of a crash.Related Issues
This pull request has no related issues.
Questions
No.
Other
1 file changed, 1 line (
.github/workflows/process_metadata.yml).Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was investigated, written, and validated by an automated Claude Code CI-monitoring routine, including root-cause investigation and independent multi-reviewer validation of the fix.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ch53UGBgsUodCvqUP9zcHz
Generated by Claude Code