github-webhook | incoming GitHub web hooks requests
kandi X-RAY | github-webhook Summary
kandi X-RAY | github-webhook Summary
Library which deals with incoming GitHub web hooks requests (signature validation & payload parsing)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Validate the signature .
- Build a GitHub event from a request .
- Validate a request signature .
- Get public message .
- Build an event .
- Returns the field type .
- Get the payload .
- Get the current request .
- Returns the signature .
- Returns the request body .
github-webhook Key Features
github-webhook Examples and Code Snippets
Community Discussions
Trending Discussions on github-webhook
QUESTION
I used the following helm chart to install Jenkins
https://artifacthub.io/packages/helm/jenkinsci/jenkins
The problem is it does't build docker images, saying there's no docker. Docker was installed on host with sudo apt install docker-ce docker-ce-cli containerd.io
ANSWER
Answered 2021-Apr-08 at 20:25You are running Jenkins itself as a container. Therefore the docker command line application must be present in the container, not the host.
Easiest solution: Use a Jenkins docker image that contains the docker cli already, for example https://hub.docker.com/r/trion/jenkins-docker-client
QUESTION
Background:
I'm developing a custom AWS github-webhook via Terraform. I'm using AWS API Gateway to trigger an AWS Lambda function that validates the GitHub webhook's sha256 signature from the request header. If the lambda function successfully validates the request, I want a child lambda function to be invoked via the async invocation destination feature provided by Lambda.
Problem:
Even though I've configured the async invocation with the target child Lambda function, the child function is not triggered when the parent Lambda function is successful. This is reflected in the fact that the child Lambda function's associated CloudWatch log group is empty.
Relevant Code:
Here's the Terraform configuration for the Lambda function destination:
...ANSWER
Answered 2021-Mar-22 at 23:37From your description it seems to me that you are invoking parent function synchronously. Lambda destinations are only for asynchronous invocations:
You can also configure Lambda to send an invocation record to another service. Lambda supports the following destinations for asynchronous invocation
So you have to execute your parent function asynchronously for your child function to be invoked.
QUESTION
I am trying to verify the Github webhook secret, but each time I trigger an event in Github, the value of req.headers['x-hub-signature'])
changes, which doesn't make sense.
ANSWER
Answered 2021-Feb-16 at 13:32req.headers['x-hub-signature'])
is not a hash of the secret, but req.body
signed with the secret. That is why it is different on each event.
QUESTION
I'm trying to use a post-receive git-hook to automate the deploy of a simple maven project by triggering a Jenkins pipeline I set up. The source is hosted on a GitHub repo while Jenkins on a container running on my PC. So far, the hook is not triggered after I push to master branch.
Thing is if I try and run the script manually it just works! I also tried setting chmod +x with Git Bash (after all I'm on Windows) to the post-receive file, unfortunately without success: the hook still does not get triggered. What might be the issue?
I already tried looking for answers on similar topics here on stackoverflow, but nothing solved my issue. FYI, below the post-receive script (nothing fancy, as you can see):
...ANSWER
Answered 2021-Feb-06 at 15:19A post-receive
hook is run on the server side, not on the client side. That means that it's run at GitHub, assuming you're pushing to GitHub, ant not on your local machine.
Normally, you'd want a GitHub webhook to notify you of the push event, but you cannot use one here because the machine is running on localhost and such an event has to be able to on a public IP address since GitHub has to send an HTTP request to it.
QUESTION
I have setup Jenkins and integrated with Github, and I am able to trigger builds on "Freestyle Projects" from a github webhook, however I have been unsuccessful in triggering one using the "Pipeline project".
In the logs (/log/all), I can see that my Jenkins instance is receiving the PushEvent from Github:
...ANSWER
Answered 2020-Aug-18 at 19:03I checked off the "Lightweight Checkout" in the last section of the Pipeline, ran a manual build which fixed the issue. Builds are now triggered from Github webhook.
I did not have to setup Github Credentials in the Github Plugin to make this work.
QUESTION
I am setting up webhook integration between a private GitHub repository and a Jenkins build. I configure jobs exclusively using Job DSL groovy scripts (I'm open to switching to another programmatic job configuration mechanism, but I will not accept any answer that requires me to configure jobs manually). II would like to set up a commit status context and a set of custom messages based on build status.
The Job DSL API documentation embedded in Jenkins is not helpful, only giving me this signature: githubPullRequest(Closure closure)
, but not telling me how to construct a suitable closure.
Here are the relevant sections of my job DSL:
...ANSWER
Answered 2020-Aug-13 at 20:29Got it figured. There were several issues, but the crux of the problem was authentication: the various plugins and components accept and require different types of credentials. The setup I have working for me now uses a combination of personal access tokens and SSH keypairs to authenticate to GitHub.
Here's how to set up authentication:
- Generate a new public-private keypair. I did this on my local machine, but you can do it anywhere. The private key file's contents will provide access to your GitHub account, so use appropriate caution when you decide where to keep the file, and clean up after yourself accordingly.
- Go to GitHub and log in as the user you want Jenkins to use to authenticate to GitHub.
- Navigate to
Settings -> SSH and GPG keys
. (Note: that's the user's settings, not a repo's settings) - Create a new SSH key. Give it a name (I named mine after the Jenkins instance) and paste in the contents of the public key generated in step 1.
- Navigate to
Settings -> Developer settings -> Personal access tokens
- Generate a new token. Grant it access to "repo". Make sure you capture the token value somewhere safe -- I saved mine in my password manager. If you lose it, you'll have to go through all of these steps again to make a new one and configure Jenkins to use it.
- My company uses a private GitHub org with SAML-based auth and SSO. If this is true for you as well, make sure you enable SSO on the token for the appropriate org(s).
- In Jenkins, go to
Manage Jenkins -> Manage Credentials
. - Create a new "SSH Username with private key" credential in the System / Global domain. In the "Username" field, enter the GitHub username. For the private key, choose "Enter directly", choose "Add", and paste in the text contents of the private key file generated in step 1.
- You'll give the credential an ID and a description as part of creating it. The ID is used in XML config files, and the description is used in the Jenkins configuration UI. I like to use the same value for both so that the value stored in the XML config files is the same as the value I see in the user interface. IDs can be uppercase and lowercase letters plus separator characters. For best readability, i-like-to-use-kebab-case.
- Create a new "Secret Text" credential in the System / Global domain. In the "Secret" field, enter the token value GitHub generated in step 6. Again, give it a description and an ID.
- In
Manage Jenkins -> Configure System -> GitHub Pull Request Builder -> Credentials
, choose the token-based credential you created in step 9.
Here's the Job DSL that worked for PRs, using the jenkins-ghprb
plugin:
QUESTION
i am trying to integrate github with jenkins. while doing this i added github webhook with below jenkins address
http://xxx.xxx.1.103:8080/github-webhook/
however on adding it in github, i get below message(as shown in screenshot-red warning) "Last delivery was not successful, could not connect to server"
When i do any commit/push jenkins build is not getting triggered. Please refer to attached screenshots.
Is there any settings i am missing here?
I tried couple of things here however could not succeed: 1.have opened my ports 8080 on internet and tried to do the push event. 2.copied "override hook url" specified in jenkins 3.instead of webhook i tried to add it as service too, but it didnot work
...ANSWER
Answered 2017-Aug-03 at 05:37I still can see you actually use 192.168.1.103
... It cannot be reached by GitHub since private IPs are not rooted in the internet.
You have to use an external IP you can reach from the Internet. If you are connected to the internet using a gateway/router than you will have to setup some kind of forwarding.
QUESTION
I am trying to configure the web hook on GitHub so that it can send the POST to http://127.0.0.1:8080/github-webhook/
My Jenkins is running on http://127.0.0.1:8080
And here is my GitHub web hook configuration:
And I get the following error:
My Jenkins is running for sure on http://127.0.0.1:8080/. So, that is not a problem for sure.
...ANSWER
Answered 2017-Apr-16 at 01:18GitHub would not know how to contact "localhost" or 127.0.0.1
: what GitHub would consider "local" is not your local machine.
You need to specify an IP address GitHub can contact over the internet. Not just "localhost".
That means your PC must expose to the internet the port 8080.
That can involve opening said port on your router for instance.
Or, at work, requesting from your IT department a firewall rule to allow traffic on that port.
QUESTION
I set up the Github webhook in Jenkins and I created a job with the following configuration:
However, every time I push something from any branch, the job build a new version (using the branch which I specified).
I set up the job by reading some related questions on Stackoverflow but all those questions are quite old and without a clear solution:
GitHub WebHooks triggered globally instead of per branch
Trigger Jenkins job on GitHub PUSH to specific branch
Is it possible to trigger Push only from a specific branch?
...ANSWER
Answered 2020-Feb-19 at 11:22You are using a GitHub Webhook to trigger a preconfigured job. Your Job has the Branch "JENKINS-TEST-AUTODEPLOYMENT" hardcoded, so it will always build this branch only, no matter which branch you are pushing on GitHub.
How about using GitHub Branch Source Plugin? With this Plugin, Hooks will be auto-created in github for the corresponding repos. Each Branch will have a job in jenkins, which is also auto-created as long as you have a Jenkinsfile inside your Repo. With this your desired state should be easily achievable.
QUESTION
I am using the latest docker image for jenkins (jenkins/jenkins:lts JENKINS_VERSION 2.208). I have started the container, configured jenkins and can manually build against a public repo. However, on my github account I have 2FA, which must remain. I have created a personal access token in Github, and used this in my jenkins config for github server section. I have validated that the connection is working by pressing the test connection link (I added secret text that used my personal access token from github):
In Github, I have wekhook settings with the IP address for where jenkins is hosted (the IP for the docker container) follwed by github-webhook (I have also tried using a dns mapped address for jenkins as well, e.g., http://jenkins-local/github-webhook), content type is application/json:.
I have github polling enabled in jenkins as well, however, it does not work on push requests to the repo. I see failure logs in Github within the webhooks section, this increases each time I make a push (the request keeps failing). I have searched wide across the internet and found documentation of suggestions on what to do, including this link here: securing your webhooks, but nothing is giving me the desired polling effect when a push is initiated and a build triggered. So my question is, is it possible to use 2FA and github webhooks? If it is possible, then what are the exact steps to do it?
...ANSWER
Answered 2019-Dec-10 at 13:40If you have 2FA enabled, you cannot authenticate with a login/pass from your tools anymore. You need to create a token that you will use in place of your password.
The official documentation should get you there in almost no time.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install github-webhook
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page