0
votes

Software Versions: github-plugin version 1.29.3
Jenkins ver. 2.163 nginx 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 webhook 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

2

2 Answers

1
votes
-1
votes

A simple quick and dirty way to parse "name" and "email" is the below, treating the JSON file as raw text (which has it's own caveats of course)

name=$(grep pusher -A5 <your_json_file> | grep  name | cut -d':' -f2 | cut -d' ' -f2 | tr -d \" | tr -d ,)
email=$(grep pusher -A5 <your_json_file> | grep email | cut -d':' -f2 | cut -d' ' -f2 | tr -d \" | tr -d ,)