Skip to content

Commit ff57d2b

Browse files
committed
ci(dependabot-summary): handle repos without a Dependabot Updates workflow
1 parent 41083a0 commit ff57d2b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/dependabot-weekly-summary.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ jobs:
125125
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126126
REPO: ${{ github.repository }}
127127
run: |
128-
RUN_ID=$(gh run list --repo "$REPO" --workflow "Dependabot Updates" --status success --limit 30 --json databaseId,name --jq 'first(.[] | select(.name | startswith("npm_and_yarn")) | .databaseId) // empty')
128+
# Repos without a dependabot.yml have no "Dependabot Updates" workflow;
129+
# treat the lookup failure as "no recent run found" rather than failing.
130+
if ! RUN_ID=$(gh run list --repo "$REPO" --workflow "Dependabot Updates" --status success --limit 30 --json databaseId,name --jq 'first(.[] | select(.name | startswith("npm_and_yarn")) | .databaseId) // empty' 2>/dev/null); then
131+
RUN_ID=""
132+
fi
129133
echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
130134
131135
- name: Extract stuck deps (only if actions pending)

0 commit comments

Comments
 (0)