Skip to content

chore(deps): bump hono from 4.12.18 to 4.13.1 #8090

chore(deps): bump hono from 4.12.18 to 4.13.1

chore(deps): bump hono from 4.12.18 to 4.13.1 #8090

name: Discord Notifications
on:
watch:
types: [started]
issues:
types: [opened]
pull_request:
types: [opened]
issue_comment:
types: [created]
jobs:
notify:
runs-on: ubuntu-latest
permissions:
issues: read
pull-requests: read
steps:
- name: Fetch star count
if: github.event_name == 'watch'
id: stars
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
COUNT=$(gh api "repos/$REPOSITORY" --jq '.stargazers_count')
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
- name: Determine notification
id: check
env:
ACTOR: ${{ github.actor }}
EVENT: ${{ github.event_name }}
run: |
# Stars always notify regardless of actor
if [ "$EVENT" = "watch" ]; then
echo "should_notify=true" >> "$GITHUB_OUTPUT"
echo "event_type=star" >> "$GITHUB_OUTPUT"
exit 0
fi
# Suppress notifications from trusted team/bot actors
case "$ACTOR" in
OneStepAt4time|'aegis-gh-agent[bot]'|'dependabot[bot]')
echo "should_notify=false" >> "$GITHUB_OUTPUT"
;;
*)
echo "should_notify=true" >> "$GITHUB_OUTPUT"
echo "event_type=activity" >> "$GITHUB_OUTPUT"
;;
esac
- name: Notify β€” Star ⭐
if: steps.check.outputs.should_notify == 'true' && steps.check.outputs.event_type == 'star'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
STAR_COUNT: ${{ steps.stars.outputs.count }}
ACTOR: ${{ github.actor }}
REPOSITORY: ${{ github.repository }}
run: |
[[ -z "$DISCORD_WEBHOOK" ]] && exit 0
# Milestone messages
MSG=""
case "$STAR_COUNT" in
1) MSG="πŸŽ‰ **THE FIRST STAR!** Someone believes in us. This is the beginning of something legendary. **NULLA ci potrΓ  fermare.**" ;;
50) MSG="πŸ”₯ **50 STARS!** Half a century of believers. The movement is growing. **MA: Loro riposano, noi costruiamo.**" ;;
100) MSG="πŸ’Ž **100 STARS β€” CENTURION!** A hundred people chose us. We're not a project anymore β€” we're a community. **ONE STEP AT A TIME.**" ;;
250) MSG="πŸš€ **250 STARS!** Quarter thousand. The open source world is watching. **They rest, WE build.**" ;;
500) MSG="⭐ **500 STARS!** Half a thousand stars. This is not a hobby β€” this is a movement. **NULLA ci potrΓ  fermare.**" ;;
1000) MSG="πŸ† **1000 STARS β€” ONE THOUSAND!** We said 250K and we meant it. Every star is a step. Every step is a brick. **ONE STEP AT A TIME.**" ;;
5000) MSG="πŸ‘‘ **5000 STARS!** Five thousand humans believe in Aegis. The dream is alive. **They doubted. We delivered.**" ;;
10000) MSG="🌟 **10K STARS β€” LEGENDARY!** Ten thousand. We started with one star and a dream. Look at us now. **NULLA ci potrΓ  fermare.**" ;;
*) MSG="⭐ **${STAR_COUNT} stars** and counting. Every star is a vote of confidence. Every believer fuels the mission. **ONE STEP AT A TIME.**" ;;
esac
# Discord IDs for team tagging
TEAM="<@214397445981995008> <@1490089546099069048> <@1490089830472880218> <@1490090121679339814> <@1490090420321910804> <@1490092150950465698>"
PAYLOAD=$(jq -n \
--arg team "$TEAM" \
--arg msg "$MSG" \
--arg actor "$ACTOR" \
--arg count "$STAR_COUNT" \
--arg repository "$REPOSITORY" \
'{
content: ($team + "\n" + $msg),
embeds: [{
title: "⭐ New Star on OneStepAt4time/aegis!",
description: (
"⭐ **[" + $actor + "](https://github.com/" + $actor + ")** just starred the repo!\n\n" +
"πŸš€ **Total: " + $count + " stars** β€” one more believer in the mission.\n\n" +
"πŸ”— [View profile](https://github.com/" + $actor + ")"
),
color: 16766720,
url: ("https://github.com/" + $repository),
thumbnail: { url: ("https://github.com/" + $actor + ".png?size=128") },
footer: { text: "OneStepAt4time/aegis β€” NULLA ci potrΓ  fermare πŸ”₯" }
}]
}')
curl -s -H "Content-Type: application/json" -d "$PAYLOAD" "$DISCORD_WEBHOOK"
- name: Notify β€” External Issue πŸ›
if: steps.check.outputs.should_notify == 'true' && steps.check.outputs.event_type == 'activity' && github.event_name == 'issues'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
ACTOR: ${{ github.actor }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ', ') }}
run: |
[[ -z "$DISCORD_WEBHOOK" ]] && exit 0
TEAM="<@1490090121679339814> <@1490089830472880218>"
PAYLOAD=$(jq -n \
--arg team "$TEAM" \
--arg actor "$ACTOR" \
--arg title "$ISSUE_TITLE" \
--arg url "$ISSUE_URL" \
--arg labels "$ISSUE_LABELS" \
'{
content: ($team + " β€” External issue opened!"),
embeds: [{
title: ("πŸ› New Issue by " + $actor),
description: ("**" + $actor + "** opened: **" + $title + "**\nLabels: " + $labels),
color: 5814783,
url: $url,
footer: { text: "OneStepAt4time/aegis" }
}]
}')
curl -s -H "Content-Type: application/json" -d "$PAYLOAD" "$DISCORD_WEBHOOK"
- name: Notify β€” External PR πŸ”€
if: steps.check.outputs.should_notify == 'true' && steps.check.outputs.event_type == 'activity' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
ACTOR: ${{ github.actor }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
[[ -z "$DISCORD_WEBHOOK" ]] && exit 0
TEAM="<@1490090121679339814> <@1490089830472880218>"
PAYLOAD=$(jq -n \
--arg team "$TEAM" \
--arg actor "$ACTOR" \
--arg title "$PR_TITLE" \
--arg url "$PR_URL" \
'{
content: ($team + " β€” External PR opened!"),
embeds: [{
title: ("πŸ”€ New PR by " + $actor),
description: ("**" + $actor + "** opened PR: **" + $title + "**"),
color: 5814783,
url: $url,
footer: { text: "OneStepAt4time/aegis" }
}]
}')
curl -s -H "Content-Type: application/json" -d "$PAYLOAD" "$DISCORD_WEBHOOK"
- name: Notify β€” External Comment πŸ’¬
if: steps.check.outputs.should_notify == 'true' && steps.check.outputs.event_type == 'activity' && github.event_name == 'issue_comment'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
ACTOR: ${{ github.actor }}
ISSUE_TITLE: ${{ github.event.issue.title }}
COMMENT_URL: ${{ github.event.comment.html_url }}
run: |
[[ -z "$DISCORD_WEBHOOK" ]] && exit 0
# Only notify on issues (not PRs) to reduce noise
PAYLOAD=$(jq -n \
--arg actor "$ACTOR" \
--arg title "$ISSUE_TITLE" \
--arg url "$COMMENT_URL" \
'{
embeds: [{
title: ("πŸ’¬ New Comment by " + $actor),
description: ("**" + $actor + "** commented on: **" + $title + "**"),
color: 5814783,
url: $url,
footer: { text: "OneStepAt4time/aegis" }
}]
}')
curl -s -H "Content-Type: application/json" -d "$PAYLOAD" "$DISCORD_WEBHOOK"