mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-06-10 13:14:55 +03:00
Delete star.yml
This commit is contained in:
@@ -1,188 +0,0 @@
|
||||
# .github/workflows/star-milestones.yml
|
||||
name: ⭐ Star Milestone Tracker
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force_check:
|
||||
description: 'Force milestone check regardless of current state'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
concurrency:
|
||||
group: star-milestone-check
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
REPO: mukul975/Anthropic-Cybersecurity-Skills
|
||||
MILESTONE_INTERVAL: 500
|
||||
VAR_NAME: LAST_STAR_MILESTONE
|
||||
|
||||
jobs:
|
||||
check-stars:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Fetch star count
|
||||
id: stars
|
||||
run: |
|
||||
RESPONSE=$(curl -s -o /tmp/repo.json -w "%{http_code}" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
"https://api.github.com/repos/$REPO")
|
||||
|
||||
if [ "$RESPONSE" != "200" ]; then
|
||||
echo "❌ GitHub API error: $RESPONSE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STARS=$(jq .stargazers_count /tmp/repo.json)
|
||||
FORKS=$(jq .forks_count /tmp/repo.json)
|
||||
echo "stars=$STARS" >> $GITHUB_OUTPUT
|
||||
echo "forks=$FORKS" >> $GITHUB_OUTPUT
|
||||
echo "✅ Stars: $STARS | Forks: $FORKS"
|
||||
|
||||
- name: Fetch last milestone
|
||||
id: last
|
||||
run: |
|
||||
RESPONSE=$(curl -s -o /tmp/var.json -w "%{http_code}" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
"https://api.github.com/repos/$REPO/actions/variables/$VAR_NAME")
|
||||
|
||||
echo "status=$RESPONSE" >> $GITHUB_OUTPUT
|
||||
|
||||
if [ "$RESPONSE" = "200" ]; then
|
||||
LAST=$(jq -r '.value' /tmp/var.json)
|
||||
else
|
||||
LAST="INIT"
|
||||
fi
|
||||
echo "value=$LAST" >> $GITHUB_OUTPUT
|
||||
echo "📌 Last milestone: $LAST"
|
||||
|
||||
- name: Evaluate milestone
|
||||
id: milestone
|
||||
run: |
|
||||
STARS=${{ steps.stars.outputs.stars }}
|
||||
LAST="${{ steps.last.outputs.value }}"
|
||||
|
||||
CURRENT=$(( (STARS / MILESTONE_INTERVAL) * MILESTONE_INTERVAL ))
|
||||
NEXT=$(( CURRENT + MILESTONE_INTERVAL ))
|
||||
REMAINING=$(( NEXT - STARS ))
|
||||
PROGRESS=$(( (STARS % MILESTONE_INTERVAL) * 100 / MILESTONE_INTERVAL ))
|
||||
|
||||
echo "current=$CURRENT" >> $GITHUB_OUTPUT
|
||||
echo "next=$NEXT" >> $GITHUB_OUTPUT
|
||||
echo "remaining=$REMAINING" >> $GITHUB_OUTPUT
|
||||
echo "progress=$PROGRESS" >> $GITHUB_OUTPUT
|
||||
|
||||
if [ "$LAST" = "INIT" ]; then
|
||||
echo "notify=false" >> $GITHUB_OUTPUT
|
||||
echo "init=true" >> $GITHUB_OUTPUT
|
||||
echo "🚀 First run — initializing baseline at $CURRENT, no notification sent"
|
||||
|
||||
elif [ "$CURRENT" -gt "$LAST" ] && [ "$CURRENT" -gt 0 ]; then
|
||||
echo "notify=true" >> $GITHUB_OUTPUT
|
||||
echo "init=false" >> $GITHUB_OUTPUT
|
||||
echo "🎉 NEW MILESTONE: $CURRENT (was $LAST)"
|
||||
|
||||
else
|
||||
echo "notify=false" >> $GITHUB_OUTPUT
|
||||
echo "init=false" >> $GITHUB_OUTPUT
|
||||
echo "💤 No new milestone. Next: $NEXT in $REMAINING stars ($PROGRESS% there)"
|
||||
fi
|
||||
|
||||
- name: Send Slack notification
|
||||
if: steps.milestone.outputs.notify == 'true'
|
||||
run: |
|
||||
STARS=${{ steps.stars.outputs.stars }}
|
||||
FORKS=${{ steps.stars.outputs.forks }}
|
||||
MILESTONE=${{ steps.milestone.outputs.current }}
|
||||
NEXT=${{ steps.milestone.outputs.next }}
|
||||
REMAINING=${{ steps.milestone.outputs.remaining }}
|
||||
PROGRESS=${{ steps.milestone.outputs.progress }}
|
||||
|
||||
if [ "$MILESTONE" -ge 10000 ]; then BADGE="🏆"
|
||||
elif [ "$MILESTONE" -ge 5000 ]; then BADGE="🔥"
|
||||
elif [ "$MILESTONE" -ge 2500 ]; then BADGE="🚀"
|
||||
elif [ "$MILESTONE" -ge 1000 ]; then BADGE="💫"
|
||||
else BADGE="⭐"
|
||||
fi
|
||||
|
||||
curl -s -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
|
||||
-H 'Content-type: application/json' \
|
||||
-d "{
|
||||
\"text\": \"$BADGE *$MILESTONE Star Milestone Reached!*\",
|
||||
\"attachments\": [{
|
||||
\"color\": \"#FFD700\",
|
||||
\"blocks\": [
|
||||
{
|
||||
\"type\": \"section\",
|
||||
\"fields\": [
|
||||
{\"type\": \"mrkdwn\", \"text\": \"*🎯 Milestone*\n$MILESTONE stars\"},
|
||||
{\"type\": \"mrkdwn\", \"text\": \"*⭐ Total Stars*\n$STARS\"},
|
||||
{\"type\": \"mrkdwn\", \"text\": \"*🍴 Forks*\n$FORKS\"},
|
||||
{\"type\": \"mrkdwn\", \"text\": \"*🔜 Next Milestone*\n$NEXT ($REMAINING to go — $PROGRESS% there)\"}
|
||||
]
|
||||
},
|
||||
{
|
||||
\"type\": \"actions\",
|
||||
\"elements\": [{
|
||||
\"type\": \"button\",
|
||||
\"text\": {\"type\": \"plain_text\", \"text\": \"View Repo ↗\"},
|
||||
\"url\": \"https://github.com/$REPO\",
|
||||
\"style\": \"primary\"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}]
|
||||
}"
|
||||
echo "✅ Slack notified"
|
||||
|
||||
- name: Save milestone
|
||||
if: steps.milestone.outputs.notify == 'true' || steps.milestone.outputs.init == 'true'
|
||||
run: |
|
||||
MILESTONE=${{ steps.milestone.outputs.current }}
|
||||
STATUS=${{ steps.last.outputs.status }}
|
||||
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
METHOD="PATCH"
|
||||
URL="https://api.github.com/repos/$REPO/actions/variables/$VAR_NAME"
|
||||
else
|
||||
METHOD="POST"
|
||||
URL="https://api.github.com/repos/$REPO/actions/variables"
|
||||
fi
|
||||
|
||||
HTTP=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-X "$METHOD" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Content-type: application/json" \
|
||||
"$URL" \
|
||||
-d "{\"name\":\"$VAR_NAME\",\"value\":\"$MILESTONE\"}")
|
||||
|
||||
if [ "$HTTP" = "200" ] || [ "$HTTP" = "201" ] || [ "$HTTP" = "204" ]; then
|
||||
echo "✅ Saved $VAR_NAME = $MILESTONE"
|
||||
else
|
||||
echo "❌ Failed to save variable (HTTP $HTTP)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "## ⭐ Star Tracker Run" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Current Stars | ${{ steps.stars.outputs.stars }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Current Forks | ${{ steps.stars.outputs.forks }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Last Milestone | ${{ steps.last.outputs.value }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Next Milestone | ${{ steps.milestone.outputs.next }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Stars to Next | ${{ steps.milestone.outputs.remaining }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Progress | ${{ steps.milestone.outputs.progress }}% |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Notified | ${{ steps.milestone.outputs.notify }} |" >> $GITHUB_STEP_SUMMARY
|
||||
Reference in New Issue
Block a user