github-plugin icon indicating copy to clipboard operation
github-plugin copied to clipboard

[JENKINS-56043] (Github plugin) Console Output not echo'ing $payload

Open jenkins-infra-bot opened this issue 6 years ago • 1 comments

I have a working jenkins instance with github-plugin (https://wiki.jenkins.io/display/JENKINS/GitHub+Plugin) configured. The job is currently accepting posts from github.com and triggering the build. I am able to parse out these 11 environment variables.

 

echo $payload returns nothing
 
{{echo GIT_COMMIT $GIT_COMMIT
echo GIT_BRANCH $GIT_BRANCH
echo GIT_LOCAL_BRANCH $GIT_LOCAL_BRANCH
echo GIT_PREVIOUS_COMMIT $GIT_PREVIOUS_COMMIT
echo GIT_PREVIOUS_SUCCESSFUL_COMMIT $GIT_PREVIOUS_SUCCESSFUL_COMMIT
echo GIT_URL $GIT_URL
echo GIT_URL_N - $GIT_URL_N
echo GIT_AUTHOR_NAME $GIT_AUTHOR_NAME
echo GIT_COMMITTER_EMAIL $GIT_COMMITTER_EMAIL}}

However i am unable to get at the PUSH webhook payload example from there https://developer.github.com/v3/activity/events/types/#pushevent

Ideally i would like to parse out this specific key and value using shell
 
{{ "pusher":

{"name": "Codertocat","email": "21031067+Codertocat@​users.noreply.github.com"}

}


Originally reported by winnjohnston, imported from: (Github plugin) Console Output not echo'ing $payload
  • assignee: lanwen
  • status: Open
  • priority: Minor
  • component(s): github-plugin
  • label(s): github-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 2025-12-08
Raw content of original issue

I have a working jenkins instance with github-plugin (https://wiki.jenkins.io/display/JENKINS/GitHub+Plugin) configured. The job is currently accepting posts from github.com and triggering the build. I am able to parse out these 11 environment variables.

 

echo $payload returns nothing   {{echo GIT_COMMIT $GIT_COMMIT echo GIT_BRANCH $GIT_BRANCH echo GIT_LOCAL_BRANCH $GIT_LOCAL_BRANCH echo GIT_PREVIOUS_COMMIT $GIT_PREVIOUS_COMMIT echo GIT_PREVIOUS_SUCCESSFUL_COMMIT $GIT_PREVIOUS_SUCCESSFUL_COMMIT echo GIT_URL $GIT_URL echo GIT_URL_N - $GIT_URL_N echo GIT_AUTHOR_NAME $GIT_AUTHOR_NAME echo GIT_COMMITTER_EMAIL $GIT_COMMITTER_EMAIL}}

However i am unable to get at the PUSH webhook payload example from there https://developer.github.com/v3/activity/events/types/#pushevent

Ideally i would like to parse out this specific key and value using shell   {{ "pusher":

{"name": "Codertocat","email": "[email protected]"}

}

jenkins-infra-bot avatar Feb 07 '19 23:02 jenkins-infra-bot

winnjohnston:
  • Original comment link
  • Raw content of original comment:

    Update on configuration: 0   Software Versions: github-plugin version 1.29.3 Jenkins ver. 2.163 ngingx reverse proxy

    Current State No communication issues, and build triggers from the push event. However no values in $payload

    GitHub Configuration:

    Github Webhook: on repo https://username:password@publicIP:port/github-webhook/

    Content type (tested both application/x-www-form-url-urlencoded & application/json)

    Event type: Just the push Event

    ..

    Jenkins Configuration:

    GitHub Project: Populated with the project URL

    This project is parameterized: String parameter payload

    Source Code Management: REPO URL & Creds Branch Master

    Build Triggers: GitHub hook trigger for GITScm polling

    Build Execute Shell:  echo "the build worked! The payload is $payload" Output: is blank for the $payload the build worked! The payload is

Update on configuration:
0
 
Software Versions: github-plugin version 1.29.3
Jenkins ver. 2.163 ngingx reverse proxy

Current State No communication issues, and build triggers from the push event. However no values in $payload

GitHub Configuration:

Github Webhook: on repo https://username:password@​publicIP:port/github-webhook/

Content type (tested both application/x-www-form-url-urlencoded & application/json)

Event type: Just the push Event

..

Jenkins Configuration:

GitHub Project: Populated with the project URL

This project is parameterized: String parameter payload

Source Code Management: REPO URL & Creds Branch Master

Build Triggers: GitHub hook trigger for GITScm polling

Build Execute Shell:
 echo "the build worked! The payload is $payload"
Output: is blank for the $payload the build worked! The payload is

jenkins-infra-bot avatar Feb 08 '19 17:02 jenkins-infra-bot