github-webhook | incoming GitHub web hooks requests

 by   Swop PHP Version: v3.1 License: MIT

kandi X-RAY | github-webhook Summary

kandi X-RAY | github-webhook Summary

github-webhook is a PHP library. github-webhook has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Library which deals with incoming GitHub web hooks requests (signature validation & payload parsing)
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              github-webhook has a low active ecosystem.
              It has 10 star(s) with 5 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 1 have been closed. On average issues are closed in 404 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of github-webhook is v3.1

            kandi-Quality Quality

              github-webhook has no bugs reported.

            kandi-Security Security

              github-webhook has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              github-webhook is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              github-webhook releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed github-webhook and discovered the below as its top functions. This is intended to give you an instant insight into github-webhook implemented functionality, and help decide if they suit your requirements.
            • 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 .
            Get all kandi verified functions for this library.

            github-webhook Key Features

            No Key Features are available at this moment for github-webhook.

            github-webhook Examples and Code Snippets

            No Code Snippets are available at this moment for github-webhook.

            Community Discussions

            QUESTION

            Unable to build Docker images through Jenkins installed on Kubernetes
            Asked 2021-May-03 at 05:16

            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:25

            You 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

            Source https://stackoverflow.com/questions/67011315

            QUESTION

            AWS Lambda destination Lambda not triggering
            Asked 2021-Mar-24 at 16:36

            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:37

            From 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.

            Source https://stackoverflow.com/questions/66749870

            QUESTION

            Why does my Github secret fail (change on each event)?
            Asked 2021-Feb-16 at 13:32

            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:32

            req.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.

            Source https://stackoverflow.com/questions/66223803

            QUESTION

            GitHub post-receive hook not triggered on Windows
            Asked 2021-Feb-07 at 12:06

            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:19

            A 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.

            Source https://stackoverflow.com/questions/66075350

            QUESTION

            Jenkins not triggering pipeline build on successful github webhook
            Asked 2020-Aug-18 at 19:03

            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:03

            I 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.

            Source https://stackoverflow.com/questions/63456809

            QUESTION

            How to configure Jenkins GitHubPullRequestBuilder plugin using Job DSL
            Asked 2020-Aug-13 at 20:29

            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:29

            Got 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:

            1. 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.
            2. Go to GitHub and log in as the user you want Jenkins to use to authenticate to GitHub.
            3. Navigate to Settings -> SSH and GPG keys. (Note: that's the user's settings, not a repo's settings)
            4. 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.
            5. Navigate to Settings -> Developer settings -> Personal access tokens
            6. 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).
            7. In Jenkins, go to Manage Jenkins -> Manage Credentials.
            8. 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.
            9. 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.
            10. 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:

            Source https://stackoverflow.com/questions/63253159

            QUESTION

            github-jenkins webhook issue
            Asked 2020-May-04 at 09:30

            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:37

            I 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.

            Source https://stackoverflow.com/questions/45475604

            QUESTION

            Jenkins+Github: We couldn’t deliver this payload: Couldn't connect to server
            Asked 2020-Apr-08 at 11:05

            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:18

            GitHub 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.

            Source https://stackoverflow.com/questions/42037370

            QUESTION

            Jenkins and Github trigger PUSH from specific branch
            Asked 2020-Feb-19 at 17:27

            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:22

            You 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.

            Source https://stackoverflow.com/questions/60299093

            QUESTION

            Is it possible to use Jenkins Webhooks with Github when the github account uses 2 factor auth
            Asked 2019-Dec-16 at 01:27

            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:40

            If 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.

            Source https://stackoverflow.com/questions/59266866

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install github-webhook

            You can download it from GitHub.
            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

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Swop/github-webhook.git

          • CLI

            gh repo clone Swop/github-webhook

          • sshUrl

            git@github.com:Swop/github-webhook.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link