mirror of
https://github.com/strongdm/comply
synced 2024-08-26 09:16:47 +00:00
29 lines
521 B
Go
29 lines
521 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/strongdm/comply/internal/model"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var syncCommand = cli.Command{
|
|
Name: "sync",
|
|
Usage: "sync ticket status to local cache",
|
|
Action: syncAction,
|
|
Before: projectMustExist,
|
|
}
|
|
|
|
func syncAction(c *cli.Context) error {
|
|
tp := model.GetPlugin(model.Github)
|
|
tickets, err := tp.FindByTagName("comply")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, t := range tickets {
|
|
err = model.DB().Write("tickets", t.ID, t)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|