Dependabot Alerts #43
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
| 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 |