jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-73106] Expose GitHub App ID/Username to the pipeline

Open
#1,439 0 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

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.

 

---
Originally reported by vilius, imported from: Expose GitHub App ID/Username to the pipeline


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

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.

 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.