Skip to content

PullRequest.Fork field is unintended content #122

Open
@kamijin-fanta

Description

It seems that the webhook payload is wrong when a Pull Request or Merge Request is issued within GitHub and GitLab.The PullRequest.Fork is always set to the repository name, even when the PR comes from a branch or fork.

I think the string should only be specified when the PR is issued from the fork repository, otherwise it should be empty.

github driver: https://github.com/drone/go-scm/blob/v1.15.2/scm/driver/github/pr.go#L153
gitlab driver: https://github.com/drone/go-scm/blob/v1.15.2/scm/driver/gitlab/webhook.go#L267
bitbucket driver: https://github.com/drone/go-scm/blob/v1.15.2/scm/driver/bitbucket/webhook.go#L585

It seems that the code that uses this library is also expected to specify an empty string if it is not forked repository.
https://github.com/drone/drone/blob/v2.4.0/plugin/secret/encrypted.go#L57

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions