Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73106

Expose GitHub App ID/Username to the pipeline

XMLWordPrintable

      It would be great if GitHub Branch Source plugin would allow exposing configured GitHub App ID or username to the pipeline, so it can be used in one-time action steps. Consider such example:

       

      def comment_detected = false
      for (comment in pullRequest.comments) {
        if (comment.user == 'my-github-app[bot]') {
          comment_detected = true
          break;
        }
      }
      if (!comment_detected) {
        pullRequest.comment('PR preview website is deployed at: https://mywebsite.example.com/' + env.CHANGE_ID + '/home')
      } 

      It would be much cleaner to write

      if (comment.user == github.context.app) { .........

      without hardcoding username in the pipeline.

       

            Unassigned Unassigned
            vilius Vilius
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: