[GITEA] add proper payload to scheduled events
This commit is contained in:
parent
83cd7a3ad9
commit
012ae8f161
2 changed files with 15 additions and 1 deletions
|
@ -402,6 +402,16 @@ func (p *PullRequestPayload) JSONPayload() ([]byte, error) {
|
|||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
type HookScheduleAction string
|
||||
|
||||
const (
|
||||
HookScheduleCreated HookScheduleAction = "created"
|
||||
)
|
||||
|
||||
type SchedulePayload struct {
|
||||
Action HookScheduleAction `json:"action"`
|
||||
}
|
||||
|
||||
// ReviewPayload FIXME
|
||||
type ReviewPayload struct {
|
||||
Type string `json:"type"`
|
||||
|
|
|
@ -423,7 +423,11 @@ func handleSchedules(
|
|||
return nil
|
||||
}
|
||||
|
||||
p, err := json.Marshal(input.Payload)
|
||||
payload := &api.SchedulePayload{
|
||||
Action: api.HookScheduleCreated,
|
||||
}
|
||||
|
||||
p, err := json.Marshal(payload)
|
||||
if err != nil {
|
||||
return fmt.Errorf("json.Marshal: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue