Skip to content

ci: fix deps-bump discover job failing on empty branch list#755

Merged
ericfitz merged 1 commit into
mainfrom
fix/deps-bump-empty-branch-list
Jun 30, 2026
Merged

ci: fix deps-bump discover job failing on empty branch list#755
ericfitz merged 1 commit into
mainfrom
fix/deps-bump-empty-branch-list

Conversation

@ericfitz

Copy link
Copy Markdown
Owner

Problem

The Dependency Bump (Claude) workflow has been failing every day. The daily cron (0 13 * * *) runs the discover job, which checks for open Dependabot alerts. When there are none — the normal outcome most days — the script logs No open Dependabot alerts — nothing to do., sets LIST="", then hits:

BRANCHES="$(printf '%s\n' "$LIST" | grep -v '^$' | jq -R . | jq -cs .)"

Under set -euo pipefail, grep -v '^$' matches no lines and exits 1; pipefail propagates the failure and set -e aborts the step. The healthy no-op path is reported as a ❌ failed run.

This is not an auth problem — the logs show the App token reads the alerts API successfully (count 0, not the ERR fallback).

Fix

Drop the fragile grep and let jq filter empty lines, which is robust under pipefail:

BRANCHES="$(printf '%s\n' "$LIST" | jq -R . | jq -cs 'map(select(length > 0))')"
  • Empty LIST[] (exit 0); the bump job skips cleanly via its existing branches != '[]' guard.
  • Populated LIST["main","dev/1.4.0", ...] (exit 0), unchanged behavior.

Verified both paths locally and confirmed the YAML still parses.

🤖 Generated with Claude Code

The discover step runs under `set -euo pipefail`. On the daily "no open
Dependabot alerts" path, LIST is empty, so `grep -v '^$'` matched no
lines and exited 1; pipefail propagated the failure and `set -e` aborted
the step — turning the healthy no-op into a failed run every day.

Replace the grep with jq-based empty-line filtering so the empty case
yields `[]` (exit 0) and the bump job skips cleanly via its existing
`branches != '[]'` guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSjF27DDtZnihmQxHYKk4u
@github-project-automation github-project-automation Bot moved this to Backlog in TMI Jun 30, 2026
@ericfitz ericfitz merged commit eb18874 into main Jun 30, 2026
2 checks passed
@ericfitz ericfitz deleted the fix/deps-bump-empty-branch-list branch June 30, 2026 02:12
@github-project-automation github-project-automation Bot moved this from Backlog to Done in TMI Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant