Files
AutoBOM/.gitea/workflows/notify.yml
Misaka_Company b5011743a9
All checks were successful
NTFY Notification / notify (push) Successful in 6s
fix: escape special characters in commit message for NTFY
Use shell variables to properly handle multi-line commit messages
and special characters that cause shell parsing errors.

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

30 lines
906 B
YAML
Raw 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: |
REPO="${{ github.repository_name }}"
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,${{ github.repository_name }}" \
-H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \
https://ntfy.server10086.icu/gitea