support for cron event type
This commit is contained in:
parent
9ac8aa26c8
commit
e97b1e968b
5 changed files with 6 additions and 4 deletions
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Added
|
||||
- support for validation plugins, by [@bradrydzewski](https://github.com/bradrydzewski). [#2266](https://github.com/drone/drone/issues/2266).
|
||||
- support for conversion plugins, by [@bradrydzewski](https://github.com/bradrydzewski).
|
||||
- support for cron event type, by [@bradrydzewski](https://github.com/bradrydzewski). [#2705](https://github.com/drone/drone/issues/2705).
|
||||
|
||||
### Removed
|
||||
- Support for basic auth as an option for Gitea, by [@techknowlogick](https://giteahub.com/techknowlogick). [#2721](https://github.com/drone/drone/issues/2721)
|
||||
|
|
|
@ -16,6 +16,7 @@ package core
|
|||
|
||||
// Hook event constants.
|
||||
const (
|
||||
EventCron = "cron"
|
||||
EventPush = "push"
|
||||
EventPullRequest = "pull_request"
|
||||
EventTag = "tag"
|
||||
|
|
|
@ -50,7 +50,7 @@ type service struct {
|
|||
}
|
||||
|
||||
func (s *service) Send(ctx context.Context, user *core.User, req *core.StatusInput) error {
|
||||
if s.disabled || req.Build.Trigger == core.TriggerCron {
|
||||
if s.disabled || req.Build.Event == core.EventCron {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ func (s *Scheduler) run(ctx context.Context) error {
|
|||
|
||||
hook := &core.Hook{
|
||||
Trigger: core.TriggerCron,
|
||||
Event: core.EventPush,
|
||||
Event: core.EventCron,
|
||||
Link: commit.Link,
|
||||
Timestamp: commit.Author.Date,
|
||||
Message: commit.Message,
|
||||
|
|
|
@ -377,7 +377,7 @@ var (
|
|||
Number: dummyRepo.Counter,
|
||||
RepoID: dummyRepo.ID,
|
||||
Status: core.StatusPending,
|
||||
Event: core.EventPush,
|
||||
Event: core.EventCron,
|
||||
Link: "https://github.com/octocat/Hello-World/commit/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
|
||||
Timestamp: 1299283200,
|
||||
Message: "first commit",
|
||||
|
@ -446,7 +446,7 @@ var (
|
|||
}
|
||||
|
||||
dummyHook = &core.Hook{
|
||||
Event: core.EventPush,
|
||||
Event: core.EventCron,
|
||||
Link: "https://github.com/octocat/Hello-World/commit/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
|
||||
Timestamp: 1299283200,
|
||||
Message: "first commit",
|
||||
|
|
Loading…
Reference in a new issue