Giter Site home page Giter Site logo

mkloubert / vscode-git-notify Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 702 KB

Visual Studio Code extension, which receives and shows git events from webhooks.

Home Page: https://marketplace.visualstudio.com/items?itemName=mkloubert.vscode-git-notify

License: GNU Lesser General Public License v3.0

TypeScript 100.00%
vscode-extension gitlab-webhook github-webhooks gitea bitbucket-webhooks webhooks git notify json-api https-server

vscode-git-notify's Introduction

vscode-git-notify

Share via Facebook Share via Twitter Share via Google+ Share via Pinterest Share via Reddit Share via LinkedIn Share via Wordpress Share via Email

Latest Release Installs Rating

Visual Studio Code extension, which receives and shows git events from webhooks.

Table of contents

  1. Install
  2. How to use
  3. Support and contribute

Install []

Launch VS Code Quick Open (Ctrl + P), paste the following command, and press enter:

ext install vscode-git-notify

Or search for things like vscode-git-notify in your editor.

How to use []

Settings []

Open (or create) your settings.json in your .vscode subfolder of your workspace.

Add a deploy.reloaded section and one or more "watchers":

{
    "git.notify": {
    }
}

The following providers and events are supported:

Event Bitbucket GitHub Gitea GitLab
Closed issues X X X
Closed pull requests X X X X
New commit / push X X X X
New issues X X X
New issue comments X X X
New pull requests X X X X
Re-opened issues X X X
Re-opened pull requests X X X

Bitbucket []

First you have to create a webhook for your repository.

Click on the Settings on the left side, then on Add webhook button in Webhooks:

Setup the URL, that should be called for an event. This URL must be able to redirect to your machine, where your VS Code instance runs. For that, you should check your firewall settings.

{
    "git.notify": {
        "watchers": {
            "23979": [
                {
                    "provider": "bitbucket"
                }
            ]
        }
    }
}

This will open a HTTP server instance on your machine on port 23979 on startup.

GitHub []

First you have to create a webhook for your repository.

Click on the Settings tab and select Webhooks on the left side:

Click on Add webhook button:

Setup the URL, that should be called for an event. This URL must be able to redirect to your machine, where your VS Code instance runs. For that, you should check your firewall settings.

Now, you can define a watcher in your settings (it is recommended to do this globally - CTRL + , / CMD + ,):

{
    "git.notify": {
        "watchers": {
            "80": [
                {
                    "secret": "Test123"
                }
            ]
        }
    }
}

This will open a HTTP server instance on your machine on port 80 on startup, by using Test123 as secret expression as defined in the webhooks settings.

Gitea []

First you have to create a webhook for your repository.

Click on the Settings tab, select Webhooks sub-tab and click on Add Webhook / Gitea:

Setup the URL, that should be called for an event. This URL must be able to redirect to your machine, where your VS Code instance runs. For that, you should check your firewall settings.

Now, you can define a watcher in your settings (it is recommended to do this globally - CTRL + , / CMD + ,):

{
    "git.notify": {
        "watchers": {
            "8080": [
                {
                    "provider": "gitea",

                    "secret": "Test123"
                }
            ]
        }
    }
}

This will open a HTTP server instance on your machine on port 8080 on startup, by using Test123 as secret expression as defined in the webhooks settings.

GitLab []

First you have to create a webhook for your repository.

Click on the Settings on the left side and click on Integrations:

Setup the URL, that should be called for an event. This URL must be able to redirect to your machine, where your VS Code instance runs. For that, you should check your firewall settings.

{
    "git.notify": {
        "watchers": {
            "5979": [
                {
                    "provider": "gitlab",

                    "secret": "Test123"
                }
            ]
        }
    }
}

This will open a HTTP server instance on your machine on port 5979 on startup, by using Test123 as secret expression as defined in the webhooks settings.

Secure HTTP []

It is highly recommended, to setup secure HTTPS instead of plain HTTP:

{
    "git.notify": {
        "watchers": {
            "443": [
                {
                    "secure": true,

                    "ca": "/path/to/ssl/fullchain.pem",
                    "cert": "/path/to/ssl/cert.pem",
                    "key": "/path/to/ssl/privkey.pem",

                    "secret": "Test 1 2 3"
                }
            ]
        }
    }
}

You can also use relative paths for the SSL files, of course. Those paths are tried to be mapped in the following order:

If you use a self-signed certificate, you should disable SSL verification in your git provider / hoster.

In GitHub, e.g., you have to click on Disable SSL verification button, when adding a web hook:

Support and contribute []

If you like the extension, you can support the project by sending a donation via PayPal to me.

To contribute, you can open an issue and/or fork this repository.

To work with the code:

  • clone this repository
  • create and change to a new branch, like git checkout -b my_new_feature
  • run npm install from your project folder
  • open that project folder in Visual Studio Code
  • now you can edit and debug there
  • commit your changes to your new branch and sync it with your forked GitHub repo
  • make a pull request

vscode-git-notify's People

Contributors

mkloubert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-git-notify's Issues

How to invoke git hooks from source control

The git hooks get executed while commiting and pushing the code via command line. But they are not getting invoked when I do commit via source control. How to enable git hooks in source control as well?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.