Files
AutoBOM/.gitea/workflows/notify.yml
Misaka_Company 9d8a7633f2
All checks were successful
NTFY Notification / notify (push) Successful in 3s
fix: extract repository name from github.repository
Use github.repository and parse with cut command since
github.repository_name is not available in Gitea Actions.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 13:06:01 +08:00

32 lines
989 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: NTFY Notification
on: [push]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send to NTFY
run: |
FULL_REPO="${{ github.repository }}"
# 从 owner/repo 格式中提取仓库名称
REPO=$(echo "$FULL_REPO" | cut -d'/' -f2)
SHA="${{ github.sha }}"
MSG="${{ github.event.head_commit.message }}"
AUTHOR="${{ github.actor }}"
BRANCH="${{ github.ref_name }}"
# 将多行消息替换为空格避免shell解析错误
MSG=$(echo "$MSG" | tr '\n' ' ' | sed 's/"/\\"/g')
curl -d "🚀 $REPO
New commit $SHA
📝 Message
$MSG
👤 Author: $AUTHOR
🌿 Branch: $BRANCH" \
-H "Title: Git Push Notification" \
-H "Priority: default" \
-H "Tags: gitea,push,$REPO" \
-H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \
https://ntfy.server10086.icu/gitea