Skip to content

Commit

Permalink
use Build.Ref to detect if Build is a pullrequest
Browse files Browse the repository at this point in the history
  • Loading branch information
foosinn committed Mar 14, 2019
1 parent bf462ee commit 3c2d27c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (p *plugin) Find(ctx context.Context, req *config.Request) (*drone.Config,

// get repo changes
changedFiles := []string{}
if req.Build.Fork != "" {
if strings.HasPrefix(req.Build.Ref, "refs/pull/") {
// use fork api to get changed files
pullRequestId, err := strconv.Atoi(strings.Split(req.Build.Ref, "/")[2])
if err != nil {
Expand Down

0 comments on commit 3c2d27c

Please sign in to comment.