jenkinsci / jenkinsci/github-branch-source-plugin
[JENKINS-73106] Expose GitHub App ID/Username to the pipeline
- 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
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
Assessment
This issue has not been assessed yet.