feat: add simple actions without integration to another code
All checks were successful
build / build (push) Successful in 2m23s

This commit is contained in:
d3m0k1d
2026-02-23 20:03:40 +03:00
parent 783645c30b
commit 66d460dbfc
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
package actions
type Action struct {
Name string
Type string
Args []string
}

View File

@@ -0,0 +1,24 @@
package actions
import (
"bytes"
"net/http"
"time"
)
func SendWebhook(url string, data []byte) (int, error) {
client := &http.Client{
Timeout: 30 * time.Second,
}
req, err := http.NewRequest("POST", url, bytes.NewReader(data))
if err != nil {
return 0, err
}
req.Header.Set("Content-Type", "application/json")
// #nosec G704 validating by admin
resp, err := client.Do(req)
if err != nil {
return 0, err
}
return resp.StatusCode, nil
}