Skip to content

Support Github Packages webhook #1699

@andyearnshaw

Description

@andyearnshaw

It looks like Discord doesn't send messages when it receives a Github package webhook.

Ideally, it would look something like this (table represents embed fields):

Package published
{payload.repository.full_name}

Name Version
{payload.package.name} {payload.package_version.version}

Published example:

Headers:

Request URL: https://discordapp.com/api/webhooks/***/github
Request method: POST
content-type: application/json
Expect: 
User-Agent: GitHub-Hookshot/25c8cea
X-GitHub-Delivery: ***
X-GitHub-Event: package

Payload:

{
  "action": "published",
  "package": {
    "id": 245669,
    "name": "image",
    "package_type": "docker",
    "html_url": "https://github.com/andyearnshaw/***/packages/245669",
    "created_at": "2020-05-28T15:20:56Z",
    "updated_at": "2020-05-28T15:20:56Z",
    "owner": {
      "login": "andyearnshaw",
      "id": 1826067,
      "node_id": "MDQ6VXNlcjE4MjYwNjc=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1826067?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/andyearnshaw",
      "html_url": "https://github.com/andyearnshaw",
      "followers_url": "https://api.github.com/users/andyearnshaw/followers",
      "following_url": "https://api.github.com/users/andyearnshaw/following{/other_user}",
      "gists_url": "https://api.github.com/users/andyearnshaw/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/andyearnshaw/starred{/ownereleaser}{/repo}",
      "subscriptions_url": "https://api.github.com/users/andyearnshaw/subscriptions",
      "organizations_url": "https://api.github.com/users/andyearnshaw/orgs",
      "repos_url": "https://api.github.com/users/andyearnshaw/repos",
      "events_url": "https://api.github.com/users/andyearnshaw/events{/privacy}",
      "received_events_url": "https://api.github.com/users/andyearnshaw/received_events",
      "type": "User",
      "site_admin": false
    },
    "package_version": {
      "id": 2008986,
      "version": "ISS-225",
      "summary": "",
      "body": "",
      "body_html": "",
      "manifest": "{\n   \"schemaVersion\": 2,\n   \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n   \"config\": {\n      \"mediaType\": \"application/vnd.docker.container.image.v1+json\",\n      \"size\": 9331,\n      \"digest\": \"sha256:d27abf668cd8cf0fc13105bf63d073ca5ad93011893821cecafdbe30cc5cfe70\"\n   },\n   \"layers\": [\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 2813316,\n         \"digest\": \"sha256:cbdbe7a5bc2a134ca8ec91be58565ec07d037386d1f1d8385412d224deafca08\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 35655965,\n         \"digest\": \"sha256:4b0cddaf9d69b5242f9e2a1a349835aa52dbb015eda633625245e3276be7d456\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 2235774,\n         \"digest\": \"sha256:63fc8294ef6b1327e165d5bb2b6afd4a7052e436f4cef41939ec3ca6e3d98597\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 283,\n         \"digest\": \"sha256:7d5b7d51bbb98d81296de16a79826ad065608068367db32efd65b16f9bdd2e10\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 127,\n         \"digest\": \"sha256:7cb9ac372bd7fe42d501831cb31b0fdc09d65f846f3c4b7055ebe5a62cb71398\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 86758,\n         \"digest\": \"sha256:7df6990349b7616b472d567b95b43b3f5a3330c56bc7ac35f599ff7d0558dd31\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 11859456,\n         \"digest\": \"sha256:c2c472e997489301212715984aada46e18235ae6930d8b3bf1fdc32b571b09b3\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 687,\n         \"digest\": \"sha256:52426fc701a6d44b7788d34faae820b9e026a5137d1294b420c9060c76d48a32\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 91416,\n         \"digest\": \"sha256:258b4ba55bde511edf7736c9eb662acab0a39514f9fffcae0f19ed1da1de70b8\"\n      }\n   ]\n}",
      "html_url": "https://github.com/andyearnshaw/***/packages/245669?version=ISS-225",
      "target_commitish": "master",
      "target_oid": "315afe16e5c00b325112afff77864512b02dbbc3",
      "created_at": "2020-05-28T15:21:14Z",
      "updated_at": "2020-05-28T15:21:15Z",
      "metadata": [

      ],
      "package_files": [ ... ]
    },
    "registry": {
      "about_url": "https://help.github.com/about-github-package-registry",
      "name": "GitHub docker registry",
      "type": "docker",
      "url": "https://docker.pkg.github.com/andyearnshaw/***",
      "vendor": "GitHub Inc"
    }
  },
  "repository": {
    "id": 227094681,
    "node_id": "MDEwOlJlcG9zaXRvcnkyMjcwOTQ2ODE=",
    "name": "***",
    "full_name": "andyearnshaw/***",
    "private": true,
    "owner": {
      "login": "andyearnshaw",
      "id": 1826067,
      "node_id": "MDQ6VXNlcjE4MjYwNjc=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1826067?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/andyearnshaw",
      "html_url": "https://github.com/andyearnshaw",
      "followers_url": "https://api.github.com/users/andyearnshaw/followers",
      "following_url": "https://api.github.com/users/andyearnshaw/following{/other_user}",
      "gists_url": "https://api.github.com/users/andyearnshaw/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/andyearnshaw/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/andyearnshaw/subscriptions",
      "organizations_url": "https://api.github.com/users/andyearnshaw/orgs",
      "repos_url": "https://api.github.com/users/andyearnshaw/repos",
      "events_url": "https://api.github.com/users/andyearnshaw/events{/privacy}",
      "received_events_url": "https://api.github.com/users/andyearnshaw/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/andyearnshaw/***",
    "description": "A Discord bot for interacting with the Animation Throwdown game's API.",
    "fork": false,
    "url": "https://api.github.com/repos/andyearnshaw/***",
    "forks_url": "https://api.github.com/repos/andyearnshaw/***/forks",
    "keys_url": "https://api.github.com/repos/andyearnshaw/***/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/andyearnshaw/***/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/andyearnshaw/***/teams",
    "hooks_url": "https://api.github.com/repos/andyearnshaw/***/hooks",
    "issue_events_url": "https://api.github.com/repos/andyearnshaw/***/issues/events{/number}",
    "events_url": "https://api.github.com/repos/andyearnshaw/***/events",
    "assignees_url": "https://api.github.com/repos/andyearnshaw/***/assignees{/user}",
    "branches_url": "https://api.github.com/repos/andyearnshaw/***/branches{/branch}",
    "tags_url": "https://api.github.com/repos/andyearnshaw/***/tags",
    "blobs_url": "https://api.github.com/repos/andyearnshaw/***/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/andyearnshaw/***/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/andyearnshaw/***/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/andyearnshaw/***/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/andyearnshaw/***/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/andyearnshaw/***/languages",
    "stargazers_url": "https://api.github.com/repos/andyearnshaw/***/stargazers",
    "contributors_url": "https://api.github.com/repos/andyearnshaw/***/contributors",
    "subscribers_url": "https://api.github.com/repos/andyearnshaw/***/subscribers",
    "subscription_url": "https://api.github.com/repos/andyearnshaw/***/subscription",
    "commits_url": "https://api.github.com/repos/andyearnshaw/***/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/andyearnshaw/***/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/andyearnshaw/***/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/andyearnshaw/***/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/andyearnshaw/***/contents/{+path}",
    "compare_url": "https://api.github.com/repos/andyearnshaw/***/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/andyearnshaw/***/merges",
    "archive_url": "https://api.github.com/repos/andyearnshaw/***/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/andyearnshaw/***/downloads",
    "issues_url": "https://api.github.com/repos/andyearnshaw/***/issues{/number}",
    "pulls_url": "https://api.github.com/repos/andyearnshaw/***/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/andyearnshaw/***/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/andyearnshaw/***/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/andyearnshaw/***/labels{/name}",
    "releases_url": "https://api.github.com/repos/andyearnshaw/***/releases{/id}",
    "deployments_url": "https://api.github.com/repos/andyearnshaw/***/deployments",
    "created_at": "2019-12-10T10:49:01Z",
    "updated_at": "2020-05-20T10:45:16Z",
    "pushed_at": "2020-05-28T15:19:12Z",
    "git_url": "git://github.com/andyearnshaw/***.git",
    "ssh_url": "git@github.com:andyearnshaw/***.git",
    "clone_url": "https://github.com/andyearnshaw/***.git",
    "svn_url": "https://github.com/andyearnshaw/***",
    "homepage": null,
    "size": 25309,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": "JavaScript",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 4,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 93,
    "license": null,
    "forks": 4,
    "open_issues": 93,
    "watchers": 0,
    "default_branch": "master"
  },
  "sender": {
    "login": "github-actions[bot]",
    "id": 41898282,
    "node_id": "MDM6Qm90NDE4OTgyODI=",
    "avatar_url": "https://avatars2.githubusercontent.com/in/15368?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/github-actions%5Bbot%5D",
    "html_url": "https://github.com/apps/github-actions",
    "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
    "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
    "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
    "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
    "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
    "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
    "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
    "type": "Bot",
    "site_admin": false
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions