Skip to content

Dependabot Alerts

Dependabot Alerts #43

name: Dependabot Alerts
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight
workflow_dispatch:
permissions:
actions: read
jobs:
check-dependabot:
runs-on: ubuntu-24.04
steps:
- name: Check for Dependabot failures
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
YESTERDAY=$(date -u -d '1 day ago' +%Y-%m-%dT%H:%M:%SZ)
FAILURES=$(gh api \
"/repos/${REPO}/actions/runs?actor=dependabot%5Bbot%5D&status=failure&created=>=${YESTERDAY}")
if [ "$(echo "$FAILURES" | jq '.total_count')" -gt 0 ]; then
echo "Found Dependabot failures!"
echo "$FAILURES" | jq '.workflow_runs[] | {name, html_url, created_at}'
# Add your alerting logic here (Slack, email, etc.)
fi