test-webhooks

1.0.0 • Public • Published

header

ctx.headers['x-event-key']; // pullrequest:fulfilled
ctx.headers['x-event-key']; // repo:push

ctx.headers['x-hook-uuid']; // 9090fb91-5df2-4772-81a0-35657904c8a0 - hook id
ctx.headers['x-request-uuid']; // 3c171c3f-2f49-4e2a-b832-4e8e2d80723f - 一个event内不变的
ctx.headers['x-b3-traceid']; // 209f81a2e8010363 每次都变

push

push hooks 返回的有用参数


// ctx.request.body,有重试机制,需要去重
{
  push: {
    changes: [
      {
        forced: false,
        old: {
          name: 'master',
          links: {
            commits: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commits/master' },
            self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/refs/branches/master' },
            html: { href: 'https://bitbucket.org/ciiri/space/branch/master' },
          },
          default_merge_strategy: 'merge_commit',
          merge_strategies: ['merge_commit', 'squash', 'fast_forward'],
          type: 'branch',
          target: {
            rendered: {},
            hash: '4487d6f618a37f7da17a79be89afa76e0233098e',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/4487d6f618a37f7da17a79be89afa76e0233098e' },
            },
            author: {
              raw: 'ciiri <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: 'Initial commit', markup: 'markdown', html: '<p>Initial commit</p>', type: 'rendered' },
            parents: [],
            date: '2021-07-11T08:42:53+00:00',
            message: 'Initial commit',
            type: 'commit',
            properties: {},
          },
        },
        links: {
          commits: {
            href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commits?include=0f89001b8269f18c37a5bcc091d2ceb2996f8043&exclude=4487d6f618a37f7da17a79be89afa76e0233098e',
          },
          html: {
            href: 'https://bitbucket.org/ciiri/space/branches/compare/0f89001b8269f18c37a5bcc091d2ceb2996f8043..4487d6f618a37f7da17a79be89afa76e0233098e',
          },
          diff: {
            href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/0f89001b8269f18c37a5bcc091d2ceb2996f8043..4487d6f618a37f7da17a79be89afa76e0233098e',
          },
        },
        created: false,
        commits: [
          {
            rendered: {},
            hash: '0f89001b8269f18c37a5bcc091d2ceb2996f8043',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/0f89001b8269f18c37a5bcc091d2ceb2996f8043' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/statuses',
              },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '1\\n', markup: 'markdown', html: '<p>1</p>', type: 'rendered' },
            parents: [
              {
                hash: '4487d6f618a37f7da17a79be89afa76e0233098e',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/4487d6f618a37f7da17a79be89afa76e0233098e' },
                },
              },
            ],
            date: '2021-07-11T09:03:30+00:00',
            message: '1\\n',
            type: 'commit',
            properties: {},
          },
        ],
        truncated: false,
        closed: false,
        new: {
          name: 'master',
          links: {
            commits: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commits/master' },
            self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/refs/branches/master' },
            html: { href: 'https://bitbucket.org/ciiri/space/branch/master' },
          },
          default_merge_strategy: 'merge_commit',
          merge_strategies: ['merge_commit', 'squash', 'fast_forward'],
          type: 'branch',
          target: {
            rendered: {},
            hash: '0f89001b8269f18c37a5bcc091d2ceb2996f8043',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/0f89001b8269f18c37a5bcc091d2ceb2996f8043' },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '1\\n', markup: 'markdown', html: '<p>1</p>', type: 'rendered' },
            parents: [
              {
                hash: '4487d6f618a37f7da17a79be89afa76e0233098e',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/4487d6f618a37f7da17a79be89afa76e0233098e' },
                },
              },
            ],
            date: '2021-07-11T09:03:30+00:00',
            message: '1\\n',
            type: 'commit',
            properties: {},
          },
        },
      },
    ],
  },
  actor: {
    display_name: 'ciiri',
    uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
      html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
      avatar: {
        href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
      },
    },
    type: 'user',
    nickname: 'ciiri',
    account_id: '60eaad0ca2243e0070098c5a',
  },
  repository: {
    scm: 'git',
    website: null,
    uuid: '{5d32d082-27a3-43a3-9ada-d7e603b66f50}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space' },
      html: { href: 'https://bitbucket.org/ciiri/space' },
      avatar: { href: 'https://bytebucket.org/ravatar/%7B5d32d082-27a3-43a3-9ada-d7e603b66f50%7D?ts=default' },
    },
    project: {
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri/projects/SPAC' },
        html: { href: 'https://bitbucket.org/ciiri/workspace/projects/SPAC' },
        avatar: { href: 'https://bitbucket.org/account/user/ciiri/projects/SPAC/avatar/32?ts=1625992972' },
      },
      type: 'project',
      name: 'space',
      key: 'SPAC',
      uuid: '{5ee72c07-ee22-471d-8d1d-a9d1b1fd845b}',
    },
    full_name: 'ciiri/space',
    owner: {
      display_name: 'ciiri',
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
        html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
        avatar: {
          href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
        },
      },
      type: 'user',
      nickname: 'ciiri',
      account_id: '60eaad0ca2243e0070098c5a',
    },
    workspace: {
      slug: 'ciiri',
      type: 'workspace',
      name: 'ciiri',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri' },
        html: { href: 'https://bitbucket.org/ciiri/' },
        avatar: { href: 'https://bitbucket.org/workspaces/ciiri/avatar/?ts=1625992822' },
      },
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    },
    type: 'repository',
    is_private: true,
    name: 'space',
  },
}

{
  push: {
    changes: [
      {
        forced: false,
        old: null,
        links: {
          commits: {
            href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commits?include=85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
          },
          html: { href: 'https://bitbucket.org/ciiri/space/branch/dev' },
        },
        created: true,
        commits: [
          {
            rendered: {},
            hash: '85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8/statuses',
              },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '3333\\n', markup: 'markdown', html: '<p>3333</p>', type: 'rendered' },
            parents: [
              {
                hash: '1735328bf2adf62b5869c42999215fe279bc9da8',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/1735328bf2adf62b5869c42999215fe279bc9da8' },
                },
              },
            ],
            date: '2021-07-11T09:25:12+00:00',
            message: '3333\\n',
            type: 'commit',
            properties: {},
          },
          {
            rendered: {},
            hash: '1735328bf2adf62b5869c42999215fe279bc9da8',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/1735328bf2adf62b5869c42999215fe279bc9da8',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/1735328bf2adf62b5869c42999215fe279bc9da8' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/1735328bf2adf62b5869c42999215fe279bc9da8',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8/statuses',
              },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '222\\n', markup: 'markdown', html: '<p>222</p>', type: 'rendered' },
            parents: [
              {
                hash: '546b3adf124abd67c590b7b85b22b7e34c89d31e',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124abd67c590b7b85b22b7e34c89d31e',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/546b3adf124abd67c590b7b85b22b7e34c89d31e' },
                },
              },
            ],
            date: '2021-07-11T09:25:03+00:00',
            message: '222\\n',
            type: 'commit',
            properties: {},
          },
          {
            rendered: {},
            hash: '546b3adf124abd67c590b7b85b22b7e34c89d31e',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124abd67c590b7b85b22b7e34c89d31e',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124abd67c590b7b85b22b7e34c89d31e/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/546b3adf124abd67c590b7b85b22b7e34c89d31e',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/546b3adf124abd67c590b7b85b22b7e34c89d31e' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/546b3adf124abd67c590b7b85b22b7e34c89d31e',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124abd67c590b7b85b22b7e34c89d31e/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124abd67c590b7b85b22b7e34c89d31e/statuses',
              },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: 'feat: xx\\n', markup: 'markdown', html: '<p>feat: xx</p>', type: 'rendered' },
            parents: [
              {
                hash: '0f89001b8269f18c37a5bcc091d2ceb2996f8043',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/0f89001b8269f18c37a5bcc091d2ceb2996f8043' },
                },
              },
            ],
            date: '2021-07-11T09:23:01+00:00',
            message: 'feat: xx\\n',
            type: 'commit',
            properties: {},
          },
          {
            rendered: {},
            hash: '0f89001b8269f18c37a5bcc091d2ceb2996f8043',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/0f89001b8269f18c37a5bcc091d2ceb2996f8043' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/0f89001b8269f18c37a5bcc091d2ceb2996f8043',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/0f89001b8269f18c37a5bcc091d2ceb2996f8043/statuses',
              },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '1\\n', markup: 'markdown', html: '<p>1</p>', type: 'rendered' },
            parents: [
              {
                hash: '4487d6f618a37f7da17a79be89afa76e0233098e',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/4487d6f618a37f7da17a79be89afa76e0233098e' },
                },
              },
            ],
            date: '2021-07-11T09:03:30+00:00',
            message: '1\\n',
            type: 'commit',
            properties: {},
          },
          {
            rendered: {},
            hash: '4487d6f618a37f7da17a79be89afa76e0233098e',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e',
              },
              comments: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e/comments',
              },
              patch: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/patch/4487d6f618a37f7da17a79be89afa76e0233098e',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/4487d6f618a37f7da17a79be89afa76e0233098e' },
              diff: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/4487d6f618a37f7da17a79be89afa76e0233098e',
              },
              approve: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e/approve',
              },
              statuses: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/4487d6f618a37f7da17a79be89afa76e0233098e/statuses',
              },
            },
            author: {
              raw: 'ciiri <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: 'Initial commit', markup: 'markdown', html: '<p>Initial commit</p>', type: 'rendered' },
            parents: [],
            date: '2021-07-11T08:42:53+00:00',
            message: 'Initial commit',
            type: 'commit',
            properties: {},
          },
        ],
        truncated: false,
        closed: false,
        new: {
          name: 'dev',
          links: {
            commits: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commits/dev' },
            self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/refs/branches/dev' },
            html: { href: 'https://bitbucket.org/ciiri/space/branch/dev' },
          },
          default_merge_strategy: 'merge_commit',
          merge_strategies: ['merge_commit', 'squash', 'fast_forward'],
          type: 'branch',
          target: {
            rendered: {},
            hash: '85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
            links: {
              self: {
                href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8',
              },
              html: { href: 'https://bitbucket.org/ciiri/space/commits/85a7946d1cd1bde69a7b790ba67b6d1c3c3ab1a8' },
            },
            author: {
              raw: 'yiyu <singleparty2012@gmail.com>',
              type: 'author',
              user: {
                display_name: 'ciiri',
                uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
                links: {
                  self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
                  html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
                  avatar: {
                    href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
                  },
                },
                type: 'user',
                nickname: 'ciiri',
                account_id: '60eaad0ca2243e0070098c5a',
              },
            },
            summary: { raw: '3333\\n', markup: 'markdown', html: '<p>3333</p>', type: 'rendered' },
            parents: [
              {
                hash: '1735328bf2adf62b5869c42999215fe279bc9da8',
                type: 'commit',
                links: {
                  self: {
                    href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/1735328bf2adf62b5869c42999215fe279bc9da8',
                  },
                  html: { href: 'https://bitbucket.org/ciiri/space/commits/1735328bf2adf62b5869c42999215fe279bc9da8' },
                },
              },
            ],
            date: '2021-07-11T09:25:12+00:00',
            message: '3333\\n',
            type: 'commit',
            properties: {},
          },
        },
      },
    ],
  },
  actor: {
    display_name: 'ciiri',
    uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
      html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
      avatar: {
        href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
      },
    },
    type: 'user',
    nickname: 'ciiri',
    account_id: '60eaad0ca2243e0070098c5a',
  },
  repository: {
    scm: 'git',
    website: null,
    uuid: '{5d32d082-27a3-43a3-9ada-d7e603b66f50}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space' },
      html: { href: 'https://bitbucket.org/ciiri/space' },
      avatar: { href: 'https://bytebucket.org/ravatar/%7B5d32d082-27a3-43a3-9ada-d7e603b66f50%7D?ts=default' },
    },
    project: {
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri/projects/SPAC' },
        html: { href: 'https://bitbucket.org/ciiri/workspace/projects/SPAC' },
        avatar: { href: 'https://bitbucket.org/account/user/ciiri/projects/SPAC/avatar/32?ts=1625992972' },
      },
      type: 'project',
      name: 'space',
      key: 'SPAC',
      uuid: '{5ee72c07-ee22-471d-8d1d-a9d1b1fd845b}',
    },
    full_name: 'ciiri/space',
    owner: {
      display_name: 'ciiri',
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
        html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
        avatar: {
          href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
        },
      },
      type: 'user',
      nickname: 'ciiri',
      account_id: '60eaad0ca2243e0070098c5a',
    },
    workspace: {
      slug: 'ciiri',
      type: 'workspace',
      name: 'ciiri',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri' },
        html: { href: 'https://bitbucket.org/ciiri/' },
        avatar: { href: 'https://bitbucket.org/workspaces/ciiri/avatar/?ts=1625992822' },
      },
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    },
    type: 'repository',
    is_private: true,
    name: 'space',
  },
}

pull requuest merge

pull requuest merge hooks 返回的有用参数


// ctx.request.body,有重试机制,需要去重
{
  pullrequest: {
    rendered: {
      description: {
        raw: '* 222\\r\\n* 3333\\r\\n* readme\\r\\n\\r\\n‌',
        markup: 'markdown',
        html: '<ul>\\n<li>222</li>\\n<li>3333</li>\\n<li>readme</li>\\n</ul>\\n<p>‌</p>',
        type: 'rendered',
      },
      title: { raw: 'Dev', markup: 'markdown', html: '<p>Dev</p>', type: 'rendered' },
    },
    type: 'pullrequest',
    description: '* 222\\r\\n* 3333\\r\\n* readme\\r\\n\\r\\n‌',
    links: {
      decline: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/decline' },
      diffstat: {
        href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diffstat/ciiri/space:47359f335715%0D546b3adf124a?from_pullrequest_id=1',
      },
      commits: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/commits' },
      self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1' },
      comments: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/comments' },
      merge: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/merge' },
      html: { href: 'https://bitbucket.org/ciiri/space/pull-requests/1' },
      activity: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/activity' },
      'request-changes': {
        href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/request-changes',
      },
      diff: {
        href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/diff/ciiri/space:47359f335715%0D546b3adf124a?from_pullrequest_id=1',
      },
      approve: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/approve' },
      statuses: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/pullrequests/1/statuses' },
    },
    title: 'Dev',
    close_source_branch: false,
    reviewers: [],
    id: 1,
    destination: {
      commit: {
        hash: '546b3adf124a',
        type: 'commit',
        links: {
          self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/546b3adf124a' },
          html: { href: 'https://bitbucket.org/ciiri/space/commits/546b3adf124a' },
        },
      },
      repository: {
        links: {
          self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space' },
          html: { href: 'https://bitbucket.org/ciiri/space' },
          avatar: { href: 'https://bytebucket.org/ravatar/%7B5d32d082-27a3-43a3-9ada-d7e603b66f50%7D?ts=default' },
        },
        type: 'repository',
        name: 'space',
        full_name: 'ciiri/space',
        uuid: '{5d32d082-27a3-43a3-9ada-d7e603b66f50}',
      },
      branch: { name: 'master' },
    },
    created_on: '2021-07-11T09:30:28.005105+00:00',
    summary: {
      raw: '* 222\\r\\n* 3333\\r\\n* readme\\r\\n\\r\\n‌',
      markup: 'markdown',
      html: '<ul>\\n<li>222</li>\\n<li>3333</li>\\n<li>readme</li>\\n</ul>\\n<p>‌</p>',
      type: 'rendered',
    },
    source: {
      commit: {
        hash: '92d4b140554f',
        type: 'commit',
        links: {
          self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/92d4b140554f' },
          html: { href: 'https://bitbucket.org/ciiri/space/commits/92d4b140554f' },
        },
      },
      repository: {
        links: {
          self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space' },
          html: { href: 'https://bitbucket.org/ciiri/space' },
          avatar: { href: 'https://bytebucket.org/ravatar/%7B5d32d082-27a3-43a3-9ada-d7e603b66f50%7D?ts=default' },
        },
        type: 'repository',
        name: 'space',
        full_name: 'ciiri/space',
        uuid: '{5d32d082-27a3-43a3-9ada-d7e603b66f50}',
      },
      branch: { name: 'dev' },
    },
    comment_count: 0,
    state: 'MERGED',
    task_count: 0,
    participants: [],
    reason: '',
    updated_on: '2021-07-11T09:31:06.718978+00:00',
    author: {
      display_name: 'ciiri',
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
        html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
        avatar: {
          href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
        },
      },
      type: 'user',
      nickname: 'ciiri',
      account_id: '60eaad0ca2243e0070098c5a',
    },
    merge_commit: {
      hash: '47359f335715',
      type: 'commit',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space/commit/47359f335715' },
        html: { href: 'https://bitbucket.org/ciiri/space/commits/47359f335715' },
      },
    },
    closed_by: {
      display_name: 'ciiri',
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
        html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
        avatar: {
          href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
        },
      },
      type: 'user',
      nickname: 'ciiri',
      account_id: '60eaad0ca2243e0070098c5a',
    },
  },
  repository: {
    scm: 'git',
    website: null,
    uuid: '{5d32d082-27a3-43a3-9ada-d7e603b66f50}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/repositories/ciiri/space' },
      html: { href: 'https://bitbucket.org/ciiri/space' },
      avatar: { href: 'https://bytebucket.org/ravatar/%7B5d32d082-27a3-43a3-9ada-d7e603b66f50%7D?ts=default' },
    },
    project: {
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri/projects/SPAC' },
        html: { href: 'https://bitbucket.org/ciiri/workspace/projects/SPAC' },
        avatar: { href: 'https://bitbucket.org/account/user/ciiri/projects/SPAC/avatar/32?ts=1625992972' },
      },
      type: 'project',
      name: 'space',
      key: 'SPAC',
      uuid: '{5ee72c07-ee22-471d-8d1d-a9d1b1fd845b}',
    },
    full_name: 'ciiri/space',
    owner: {
      display_name: 'ciiri',
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
        html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
        avatar: {
          href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
        },
      },
      type: 'user',
      nickname: 'ciiri',
      account_id: '60eaad0ca2243e0070098c5a',
    },
    workspace: {
      slug: 'ciiri',
      type: 'workspace',
      name: 'ciiri',
      links: {
        self: { href: 'https://api.bitbucket.org/2.0/workspaces/ciiri' },
        html: { href: 'https://bitbucket.org/ciiri/' },
        avatar: { href: 'https://bitbucket.org/workspaces/ciiri/avatar/?ts=1625992822' },
      },
      uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    },
    type: 'repository',
    is_private: true,
    name: 'space',
  },
  actor: {
    display_name: 'ciiri',
    uuid: '{42849ccb-276c-4963-b50e-d930377b28cd}',
    links: {
      self: { href: 'https://api.bitbucket.org/2.0/users/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D' },
      html: { href: 'https://bitbucket.org/%7B42849ccb-276c-4963-b50e-d930377b28cd%7D/' },
      avatar: {
        href: 'https://secure.gravatar.com/avatar/c5b2b935060642243af8db077b536f28?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FC-0.png',
      },
    },
    type: 'user',
    nickname: 'ciiri',
    account_id: '60eaad0ca2243e0070098c5a',
  },
}

Readme

Keywords

none

Package Sidebar

Install

npm i test-webhooks

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

40.2 kB

Total Files

3

Last publish

Collaborators

  • singleparty