Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/monitor-actions-usage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Monitor Actions Usage
on:
schedule:
- cron: '0 0 1 * *' # Monthly on 1st
workflow_dispatch:

jobs:
report:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Get Actions Usage
run: |
echo "## GitHub Actions Usage Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Repository: ${{ github.repository }}" >> $GITHUB_STEP_SUMMARY
echo "Report Date: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Get last 100 workflow runs
gh api "/repos/${{ github.repository }}/actions/runs?per_page=100" \
--jq '.workflow_runs[] | select(.updated_at >= (now - 30*86400 | strftime("%Y-%m-%dT%H:%M:%SZ"))) | {name: .name, status: .conclusion, duration_ms: .run_duration_ms, created: .created_at}' \
> /tmp/runs.json || true

echo "### Last 30 Days Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Count total runs
TOTAL_RUNS=$(cat /tmp/runs.json | wc -l)
echo "- Total workflow runs: $TOTAL_RUNS" >> $GITHUB_STEP_SUMMARY

# Calculate total duration (approximate minutes)
TOTAL_MS=$(cat /tmp/runs.json | grep -o '"duration_ms":[0-9]*' | grep -o '[0-9]*' | awk '{sum+=$1} END {print sum}')
TOTAL_MIN=$((TOTAL_MS / 60000))
echo "- Total compute time: ~$TOTAL_MIN minutes" >> $GITHUB_STEP_SUMMARY

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create artifact
run: |
mkdir -p reports
date > reports/report-$(date +%Y-%m).txt
echo "Usage report generated" >> reports/report-$(date +%Y-%m).txt

- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: actions-usage-report
path: reports/
retention-days: 90
4 changes: 2 additions & 2 deletions .github/workflows/scheduled-claude-code-dependency-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Scheduled - Dependency Audit

on:
schedule:
# Run every 2 weeks (1st and 15th of each month) at 10 AM UTC
- cron: '0 10 1,15 * *'
# Run on the 1st of each month at 10 AM UTC
- cron: '0 10 1 * *'
workflow_dispatch:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scheduled-claude-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Scheduled - Code Quality Review

on:
schedule:
# Run every Sunday at 8 AM UTC
- cron: '0 8 * * 0'
# Run on the 1st of each month at 8 AM UTC
- cron: '0 8 1 * *'
workflow_dispatch:
inputs:
num_dirs:
Expand Down
Loading