Skip to content

Allow comments by GitHub applications to trigger builds #138

Description

@sgleske-ias

What feature do you want to see added?

I make extensive use of GitHub apps. We use it for integrating pretty much all things Jenkins even glue code.

It would be nice if internal-only (and optionally 3rd party) GitHub apps are able to trigger builds. e.g. allowing user configurable AppIDs when determining authorization for comment triggers.

Example bot comment

Image

Enabling all logging for the following classes allowed me to trace confirming GitHub sends webhooks and Jenkins accepts webhooks (but does not trigger builds).

  • org.jenkinsci.plugins.github.webhook.GHEventHeader$PayloadHandler
  • org.jenkinsci.plugins.github.webhook.GHEventPayload$PayloadHandler
  • org.jenkinsci.plugins.github.webhook.GHWebhookSignature
  • org.jenkinsci.plugins.pipeline.github.GitHubHelper

The webhook payload replaces "triggered by user" information with instead the following payload information.

  "comment": {
...redacted
    "user": {
      "login": "jenkins-ng-prod[bot]",
...redacted
      "type": "Bot",
      "user_view_type": "public",
      "site_admin": false
    },
...redacted
    "body": "run only required",
    "author_association": "NONE",
....
...
    "performed_via_github_app": {
      "id": redacted,
      "client_id": "redacted",
      "slug": "jenkins-ng-prod",
      "node_id": "redacted",
      "owner": {
        "login": "your-github-organization",
        "id": redacted,
        "node_id": "redacted=",
        "avatar_url": "redacted",
...redacted
        "type": "Organization",
        "user_view_type": "public",
        "site_admin": false
      },
...

Upstream changes

It's possible that GitHub branch source plugin is stopping the triggering I've not completed my investigation.

Are you interested in contributing this feature?

No capacity at this time though I am interested in contributing code for this feature. Let's use this issue to brainstorm how this could be user-configurable.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions