github-webhook | GitHub WebHook deployable on CloudFoundry | REST library

 by   homedepot Go Version: Current License: Apache-2.0

kandi X-RAY | github-webhook Summary

kandi X-RAY | github-webhook Summary

github-webhook is a Go library typically used in Web Services, REST, Prometheus applications. 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.

GitHub WebHook deployable on CloudFoundry
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

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

            kandi-Quality Quality

              github-webhook has 0 bugs and 0 code smells.

            kandi-Security Security

              github-webhook has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              github-webhook code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              github-webhook is licensed under the Apache-2.0 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 not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              It has 1043 lines of code, 41 functions and 12 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            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.
            • HttpHandler is the http handler
            • flattenData recursively recursively flattens the flattened map .
            • Matches returns true if the trigger matches the event .
            • The kingpin constructor
            • LoadBytes loads a YAML configuration from a byte array
            • Execute runs the trigger
            • Start the status loop
            • validateTrigger tests that the trigger is valid
            • LoadFile loads configuration from a file
            • validateSignature returns true if the request is equal to the given payload .
            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

            Why is "continuous-integration/jenkins/pr-merge" not being triggered by GitHub on a pull request?
            Asked 2021-Dec-08 at 20:18

            In GitHub Enterprise, we have Project A under Organization A. When I submit a PR (pull request) to Project A, the continuous-integration/jenkins/pr-merge is triggered which runs a Jenkins pipeline to build the code and perform unit tests. This allows us to prevent the PR from being merged into master if the unit tests fail.

            For example, this is what I see on a PR for Project A in GitHub that includes a broken unit test:

            Now I am trying to configure Project B under Organization B to behave the same way. However, it is not working. This is what I see on a PR for Project B in GitHub that includes a broken unit test:

            Notice that Project B's PR did not kick off the continuous-integration/jenkins/pr-merge.

            Configuration of Project A and Project B

            GitHub -> Settings -> Branches -> Branch protection rules

            Project A in GitHub has a branch protection rule for master with only one setting enabled:

            • Require pull request reviews before merging

            Interestingly, the "Require status checks to pass before merging" setting is not enabled. Out of curiosity, I enabled it (without saving it) and noticed that "continuous-integration/jenkins/pr-merge" showed up below it as an option.

            I configured Project B to have the exact same branch protection rule for master with only "Require pull request reviews before merging" enabled. Out of curiosity, I enabled "Require status checks to pass before merging" (without saving it) and it doesn't even show continuous-integration/jenkins/pr-merge as an option. It just says "No status checks found. Sorry, we couldn’t find any status checks in the last week for this repository."

            GitHub -> Settings -> Hooks -> Webhooks

            Project A in GitHub has a webhook configured with:

            • Payload URL https://jenkins.mycompany.com/github-webhook/
            • Content type application/json
            • Let me select individual events: Pull requests, Pushes, Repositories are checked
            • Active: checked

            I created a webhook for Project B with the exact same settings. After I submitted a PR for Project B, I see a couple of items under "Recent Deliveries" for Project B's webhook with green checkmarks and "200" response codes, so I think it is configured correctly.

            CloudBees Jenkins Enterprise

            In Jenkins Enterprise, Project A's pipeline is of type "GitHub Organization" and has the following settings:

            • API endpoint: kubernetes-cbs-automation (https://git.mycompany.com/api/v3)
            • Credentials: [credentials specific to Project A]
            • Owner: [Project A's GitHub organization]
            • Behaviors: Repositories: Filter by name (with regular expression): Regular expression: [name of Project A's GitHub repo]
            • Behaviors: Within repository: Discover pull requests from origin: Strategy: Merging the pull request with the current target branch revision
            • Project Recognizers: Pipeline Jenkinsfile: Script Path: ci-cd/jenkins/ProjectA-pipeline.groovy
            • Property strategy: All branches get the same properties
            • Scan Organization Triggers: "Periodically if not otherwise run" checked: Interval: 1 day
            • Orphaned Item Strategy: "Discard old items" checked
            • Child Orphaned Item Strategy: Strategy: Inherited
            • Child Scan Triggers: "Periodically if not otherwise run" checked: Interval: 1 day
            • Automatic branch project triggering: Branch names to build automatically: .*

            I created an item under Project B in Jenkins Enterprise of type "GitHub Organization" with the same settings (except any settings specific to Project A were replaced with the appropriate Project B specific settings).

            What is wrong/missing?

            Given that GitHub PRs for Project B are failing to launch the continuous-integration/jenkins/pr-merge, it seems like there is some configuration that I am missing. Unfortunately, our GitHub/Jenkins admins have not been able to figure out what is wrong.

            UPDATE

            We have confirmed that Project B is actually launching a build on the Jenkins agent when a PR is submitted. The problem is that GitHub is not showing the continuous-integration/jenkins/pr-merge on the web page for the PR. We need that so the PR can be blocked if the build fails, and also so that we can quickly see what went wrong.

            ...

            ANSWER

            Answered 2021-Dec-08 at 20:18

            Posting as answer the resolution we got in the comments.

            The issue was that the user who's token was used in Jenkins did not have the right level of access to post status checks on the repository.

            Differences between the Orgs and Projects

            • OrgA/ProjectA - the user is a Member of the organisation (OrgA) also added in the Collaborators section of the repo with Read access, as well as member of a Team with Write access on the repo itself (ProjectA).
            • OrgB/ProjectB - the user was a Member of the organisation (OrgB) and also in the Collaborators section on the repo itself (ProjectB) but with Read access.

            This caused the issue on projectB status checks not being populated with Jenkins' information from the builds:
            continuous-integration/jenkins/pr-merge missing from the status checks of GitHub repository.

            Summary:
            When setting up a connection between GitHub and Jenkins we need to provide the user holder of the token with the required access.

            In this case we want to update the github status which needs Write access level:

            The token of the user should have scope repo:status

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

            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

            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

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

            Vulnerabilities

            No vulnerabilities reported

            Install github-webhook

            While this webhook is not directly coupled with Concourse, I've built it to provide functionality currently missing. In order to minimize the polling to Github Enterprise.
            Make sure you've read and followed the pre-requisites
            Clone this repo
            Run ./vssh. This will ssh into the disposable vm
            Run script/cibuild to run the build

            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/homedepot/github-webhook.git

          • CLI

            gh repo clone homedepot/github-webhook

          • sshUrl

            git@github.com:homedepot/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

            Explore Related Topics

            Consider Popular REST Libraries

            public-apis

            by public-apis

            json-server

            by typicode

            iptv

            by iptv-org

            fastapi

            by tiangolo

            beego

            by beego

            Try Top Libraries by homedepot

            spingo

            by homedepotShell

            flow

            by homedepotPython

            flop

            by homedepotGo

            infinite-wish-board

            by homedepotJavaScript

            k8s-global-objects

            by homedepotGo