From edc793e3aa5f4b28b1e9d83efee5da568556a8ba Mon Sep 17 00:00:00 2001 From: Alexey Bagno Date: Wed, 2 Sep 2026 20:07:59 +0500 Subject: [PATCH] feat: notify script --- config.yaml | 4 ++++ scripts/notify.sh | 3 +++ 2 files changed, 7 insertions(+) create mode 100755 scripts/notify.sh diff --git a/config.yaml b/config.yaml index 9247acf..a035f32 100644 --- a/config.yaml +++ b/config.yaml @@ -14,6 +14,10 @@ monitor: script: scripts/mem.sh refresh: 5 exec: + - name: notify + script: scripts/notify.sh + args: 1 + arg_types: [text] - name: greet script: scripts/greet.sh args: 2 diff --git a/scripts/notify.sh b/scripts/notify.sh new file mode 100755 index 0000000..21a3a46 --- /dev/null +++ b/scripts/notify.sh @@ -0,0 +1,3 @@ +BODY="{'text':$1}" +SIG=$(printf %s "$BODY" | openssl dgst -sha256 -hmac "a28b01dd9125753dc41945e4859b4e1007fa35305173451a" | awk '{print $2}') +curl -s -X POST http://127.0.0.1:8644/webhooks/gitea-deploy -H "Content-Type: application/json" -H "X-Hub-Signature-256: sha256=$SIG" -d "$BODY"