2019-12-20 20:47:50 +00:00
|
|
|
// Copyright (c) 2019, the Drone Plugins project authors.
|
|
|
|
// Please see the AUTHORS file for details. All rights reserved.
|
|
|
|
// Use of this source code is governed by an Apache 2.0 license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
package drone
|
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
type (
|
|
|
|
// Commit represents the current commit being built.
|
|
|
|
Commit struct {
|
|
|
|
// SHA for the current commit.
|
|
|
|
SHA string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Before contains the commit sha before the patch is applied.
|
|
|
|
Before string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// After contains the commit sha after the patch is applied.
|
|
|
|
After string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Ref for the current commit.
|
|
|
|
Ref string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Branch target for the push or pull request. This may be empty for
|
|
|
|
// tag events.
|
|
|
|
Branch string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Link to the commit or object in the source control management system.
|
|
|
|
Link string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Message for the current commit.
|
|
|
|
Message Message
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// Author of the commit.
|
|
|
|
Author Author
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// AuthorName of the commit.
|
|
|
|
AuthorName string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// AuthorEmail of the commit.
|
|
|
|
AuthorEmail string
|
2019-12-20 20:47:50 +00:00
|
|
|
|
2020-09-10 18:01:00 +00:00
|
|
|
// AuthorAvatar of the commit.
|
|
|
|
AuthorAvatar string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Author of a Commit.
|
|
|
|
Author struct {
|
|
|
|
// Username of the Commit author.
|
|
|
|
Username string
|
|
|
|
// Name of the Commit author.
|
|
|
|
Name string
|
|
|
|
// Email for the Commit author.
|
|
|
|
Email string
|
|
|
|
// Avatar for the Commit author.
|
|
|
|
Avatar string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Message for a Commit.
|
|
|
|
Message struct {
|
|
|
|
// Title for the Commit.
|
|
|
|
Title string
|
|
|
|
// Body of the Commit message.
|
|
|
|
Body string
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func (a Author) String() string {
|
|
|
|
return a.Username
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m Message) String() string {
|
|
|
|
return m.Title + m.Body
|
2019-12-20 20:47:50 +00:00
|
|
|
}
|