mirror of
https://github.com/thegeeklab/wp-plugin-go.git
synced 2024-11-22 10:20:39 +00:00
feat: expose commit title and description in addition to full message (#21)
This commit is contained in:
parent
edebd80492
commit
1d057f04d8
@ -15,6 +15,8 @@
|
|||||||
package plugin
|
package plugin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -31,6 +33,8 @@ type (
|
|||||||
Branch string
|
Branch string
|
||||||
Tag string
|
Tag string
|
||||||
Message string
|
Message string
|
||||||
|
Title string
|
||||||
|
Description string
|
||||||
Author Author
|
Author Author
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +141,8 @@ func currFromContext(c *cli.Context) Commit {
|
|||||||
Branch: c.String("commit.branch"),
|
Branch: c.String("commit.branch"),
|
||||||
Tag: c.String("commit.tag"),
|
Tag: c.String("commit.tag"),
|
||||||
Message: c.String("commit.message"),
|
Message: c.String("commit.message"),
|
||||||
|
Title: strings.Split(c.String("commit.message"), "\n")[0],
|
||||||
|
Description: strings.Split(c.String("commit.message"), "\n")[1],
|
||||||
Author: Author{
|
Author: Author{
|
||||||
Name: c.String("commit.author.name"),
|
Name: c.String("commit.author.name"),
|
||||||
Email: c.String("commit.author.email"),
|
Email: c.String("commit.author.email"),
|
||||||
@ -212,6 +218,8 @@ func prevFromContext(c *cli.Context) Commit {
|
|||||||
Refspec: c.String("prev.commit.refspec"),
|
Refspec: c.String("prev.commit.refspec"),
|
||||||
Branch: c.String("prev.commit.branch"),
|
Branch: c.String("prev.commit.branch"),
|
||||||
Message: c.String("prev.commit.message"),
|
Message: c.String("prev.commit.message"),
|
||||||
|
Title: strings.Split(c.String("commit.message"), "\n")[0],
|
||||||
|
Description: strings.Split(c.String("commit.message"), "\n")[1],
|
||||||
Author: Author{
|
Author: Author{
|
||||||
Name: c.String("prev.commit.author.name"),
|
Name: c.String("prev.commit.author.name"),
|
||||||
Email: c.String("prev.commit.author.email"),
|
Email: c.String("prev.commit.author.email"),
|
||||||
|
Loading…
Reference in New Issue
Block a user