fix(ci): don't fail deps-bump discover when the branch list is empty#515
Merged
Conversation
On the daily schedule with no open Dependabot alerts, LIST is empty and `grep -v '^$'` matched no lines, exiting 1. Under `set -euo pipefail` that aborted the discover step, turning the intended no-op run red (run 28594307464). Drop grep and filter empties in jq instead, matching the fix already in the tmi-ux repo so both workflows stay harmonized. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk9GxWS9EpazjbwBKfMpUX
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.
Problem
The daily Dependency Bump (Claude) schedule fails in the
discoverjob whenever there are no open Dependabot alerts — the common case (e.g. run 28594307464).It's a false failure: the job correctly decides there's nothing to do (
No open Dependabot alerts — nothing to do.), setsLIST="", then builds the branch array with:BRANCHES="$(printf '%s\n' "$LIST" | grep -v '^$' | jq -R . | jq -cs .)"With
LISTempty,grep -v '^$'matches no lines and exits 1. Underset -euo pipefail(+bash -e), that non-zero aborts the step, so the intended no-op run goes red. (bumpstill skips correctly — only the red X is wrong.)Fix
Drop
grepand filter empty lines injqinstead, so no step depends on grep's exit-1-on-no-match:BRANCHES="$(printf '%s\n' "$LIST" | jq -R . | jq -cs 'map(select(length > 0))')"Empty
LIST→[](bump skips, run green); non-empty lists are unchanged.Harmonization
This is the identical line already used in the sibling tmi-ux repo's
deps-bump.yml, which fixed the same bug. After this change the two repos'discoverscripts are byte-for-byte identical again.🤖 Generated with Claude Code