mirror of
https://github.com/harness/drone.git
synced 2025-05-11 14:40:05 +08:00
post-commit hook should trigger commit status update
This commit is contained in:
parent
fb2999c35d
commit
7f162c80b9
@ -1,10 +1,12 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"github.com/drone/drone/common"
|
"github.com/drone/drone/common"
|
||||||
|
"github.com/drone/drone/common/httputil"
|
||||||
"github.com/drone/drone/parser"
|
"github.com/drone/drone/parser"
|
||||||
"github.com/drone/drone/parser/inject"
|
"github.com/drone/drone/parser/inject"
|
||||||
"github.com/drone/drone/parser/matrix"
|
"github.com/drone/drone/parser/matrix"
|
||||||
@ -147,6 +149,17 @@ func PostHook(c *gin.Context) {
|
|||||||
|
|
||||||
c.JSON(200, build)
|
c.JSON(200, build)
|
||||||
|
|
||||||
|
link := fmt.Sprintf(
|
||||||
|
"%s/%s/%d",
|
||||||
|
httputil.GetURL(c.Request),
|
||||||
|
repo.FullName,
|
||||||
|
build.Number,
|
||||||
|
)
|
||||||
|
err = remote.Status(user, repo, build, link)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number)
|
||||||
|
}
|
||||||
|
|
||||||
queue_.Publish(&queue.Work{
|
queue_.Publish(&queue.Work{
|
||||||
User: user,
|
User: user,
|
||||||
Repo: repo,
|
Repo: repo,
|
||||||
|
Loading…
Reference in New Issue
Block a user