diff --git a/plugin/plugin.go b/plugin/plugin.go index e6dd38f..135b4eb 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -92,6 +92,15 @@ func (p *Plugin) Find(ctx context.Context, droneRequest *config.Request) (*drone // getConfig retrieves drone config data from the repo func (p *Plugin) getConfig(ctx context.Context, req *request) (string, error) { + logrus.WithFields(logrus.Fields{ + "after": req.Build.After, + "before": req.Build.Before, + "branch": req.Repo.Branch, + "ref": req.Build.Ref, + "slug": req.Repo.Slug, + "trigger": req.Build.Trigger, + }).Debugf("drone-tree-config environment") + // get changed files changedFiles, err := p.getScmChanges(ctx, req) if err != nil { diff --git a/plugin/scm.go b/plugin/scm.go index b8bdee1..23ced63 100644 --- a/plugin/scm.go +++ b/plugin/scm.go @@ -51,16 +51,9 @@ func (p *Plugin) getScmChanges(ctx context.Context, req *request) ([]string, err } } else { // use diff to get changed files - repoBranch := req.Repo.Branch - commitBranch := req.Build.Source before := req.Build.Before after := req.Build.After - // check for branch pr - if commitBranch != repoBranch { - before = repoBranch - } - // check for broken before if before == "0000000000000000000000000000000000000000" || before == "" { before = fmt.Sprintf("%s~1", after)