mirror of
https://github.com/harness/drone.git
synced 2025-05-10 22:21:22 +08:00
use pull request ref for pipelines commit ref (#749)
This commit is contained in:
parent
f0d87f4437
commit
780180260c
@ -23,8 +23,6 @@ import (
|
|||||||
"github.com/harness/gitness/app/pipeline/triggerer"
|
"github.com/harness/gitness/app/pipeline/triggerer"
|
||||||
"github.com/harness/gitness/events"
|
"github.com/harness/gitness/events"
|
||||||
"github.com/harness/gitness/types/enum"
|
"github.com/harness/gitness/types/enum"
|
||||||
|
|
||||||
"github.com/drone/go-scm/scm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Service) handleEventPullReqCreated(ctx context.Context,
|
func (s *Service) handleEventPullReqCreated(ctx context.Context,
|
||||||
@ -108,6 +106,6 @@ func (s *Service) augmentPullReqInfo(
|
|||||||
hook.Target = pullreq.TargetBranch
|
hook.Target = pullreq.TargetBranch
|
||||||
hook.Source = pullreq.SourceBranch
|
hook.Source = pullreq.SourceBranch
|
||||||
// expand the branch to a git reference.
|
// expand the branch to a git reference.
|
||||||
hook.Ref = scm.ExpandRef(pullreq.SourceBranch, "refs/heads")
|
hook.Ref = fmt.Sprintf("refs/pullreq/%d/head", pullreq.Number)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user