MLH-Fellowship / CodeOfDuty

Gamified Sprint System
MIT License
3 stars 0 forks source link

Create Webhooks in the Repo #32

Closed ajwad-shaikh closed 3 years ago

ajwad-shaikh commented 3 years ago

Description

Proposed Changes:

Issue Number(s): Partial fix for #24

Screenshots (if appropriate):

How Has This Been Tested?

Response from GitHub

{
    "req": {
        "method": "POST",
        "url": "https://api.github.com/repos/ajwad-shaikh/CloudNine/hooks",
        "data": {
            "name": "web",
            "config": {
                "url": "https://smee.io/xxxxxxxxxxxxxxxx",
                "content_type": "json",
                "insecure_ssl": 0
            },
            "events": [
                "issues"
            ]
        },
        "headers": {
            "accept": "application/vnd.github.v3+json",
            "authorization": "token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "user-agent": "CodeOfDuty",
            "content-type": "application/json"
        }
    },
    "header": {
        "date": "Fri, 20 Nov 2020 21:09:31 GMT",
        "content-type": "application/json; charset=utf-8",
        "content-length": "560",
        "connection": "close",
        "server": "GitHub.com",
        "status": "201 Created",
        "cache-control": "private, max-age=60, s-maxage=60",
        "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With, Accept-Encoding",
        "etag": "\"fad38969ef96e2c48f082ce2621b9722d1586b4c2ddced5340b6d9399b5aa643\"",
        "x-oauth-scopes": "admin:repo_hook, public_repo, user",
        "x-accepted-oauth-scopes": "admin:repo_hook, public_repo, repo, write:repo_hook",
        "x-oauth-client-id": "ef37d21f2e2a5d06f28a",
        "location": "https://api.github.com/repos/ajwad-shaikh/CloudNine/hooks/263771649",
        "x-github-media-type": "github.v3; format=json",
        "x-ratelimit-limit": "5000",
        "x-ratelimit-remaining": "4996",
        "x-ratelimit-reset": "1605908950",
        "x-ratelimit-used": "4",
        "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
        "access-control-allow-origin": "*",
        "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
        "x-frame-options": "deny",
        "x-content-type-options": "nosniff",
        "x-xss-protection": "1; mode=block",
        "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
        "content-security-policy": "default-src 'none'",
        "x-github-request-id": "FDF6:0A9E:C908F:108F4D:5FB8308B"
    },
    "status": 201,
    "text": "{\"type\":\"Repository\",\"id\":263771649,\"name\":\"web\",\"active\":true,\"events\":[\"issues\"],\"config\":{\"content_type\":\"json\",\"insecure_ssl\":\"0\",\"url\":\"https://smee.io/m8oDGFr6zZYAvGSS\"},\"updated_at\":\"2020-11-20T21:09:31Z\",\"created_at\":\"2020-11-20T21:09:31Z\",\"url\":\"https://api.github.com/repos/ajwad-shaikh/CloudNine/hooks/263771649\",\"test_url\":\"https://api.github.com/repos/ajwad-shaikh/CloudNine/hooks/263771649/test\",\"ping_url\":\"https://api.github.com/repos/ajwad-shaikh/CloudNine/hooks/263771649/pings\",\"last_response\":{\"code\":null,\"status\":\"unused\",\"message\":null}}"
}

Pull request type

Please check the type of change your PR introduces: - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## Checklist Please check if your PR fulfills the following requirements: - [x] All new and existing tests passed - [x] Tests for the changes have been added - [x] Docs have been reviewed and added/updated if needed - [x] My code follows the code style of this project and lint has passed locally