woodpecker/server/forge/gitea/fixtures/hooks.go
qwerty287 9df572ef31
Add release event trigger (#3226)
Supersedes #764 

Bitbucket does not support release webhooks.

---------

Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-01-30 17:39:00 +01:00

1150 lines
36 KiB
Go

// Copyright 2018 Drone.IO Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package fixtures
// HookPush is a sample Gitea push hook
const HookPush = `
{
"ref": "refs/heads/main",
"before": "4b2626259b5a97b6b4eab5e6cca66adb986b672b",
"after": "ef98532add3b2feb7a137426bba1248724367df5",
"compare_url": "http://gitea.golang.org/gordon/hello-world/compare/4b2626259b5a97b6b4eab5e6cca66adb986b672b...ef98532add3b2feb7a137426bba1248724367df5",
"commits": [
{
"id": "ef98532add3b2feb7a137426bba1248724367df5",
"message": "bump\n",
"url": "http://gitea.golang.org/gordon/hello-world/commit/ef98532add3b2feb7a137426bba1248724367df5",
"author": {
"name": "Gordon the Gopher",
"email": "gordon@golang.org",
"username": "gordon"
},
"added": ["CHANGELOG.md"],
"removed": [],
"modified": ["app/controller/application.rb"]
}
],
"repository": {
"id": 1,
"name": "hello-world",
"full_name": "gordon/hello-world",
"html_url": "http://gitea.golang.org/gordon/hello-world",
"ssh_url": "git@gitea.golang.org:gordon/hello-world.git",
"clone_url": "http://gitea.golang.org/gordon/hello-world.git",
"description": "",
"website": "",
"watchers": 1,
"owner": {
"name": "gordon",
"email": "gordon@golang.org",
"login": "gordon",
"username": "gordon"
},
"private": true,
"permissions": {
"admin": true,
"push": true,
"pull": true
}
},
"pusher": {
"name": "gordon",
"email": "gordon@golang.org",
"username": "gordon",
"login": "gordon"
},
"sender": {
"login": "gordon",
"id": 1,
"username": "gordon",
"email": "gordon@golang.org",
"avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
}
}
`
// HookPushBranch is a sample Gitea push hook where a new branch was created from an existing commit
const HookPushBranch = `
{
"ref": "refs/heads/fdsafdsa",
"before": "0000000000000000000000000000000000000000",
"after": "28c3613ae62640216bea5e7dc71aa65356e4298b",
"compare_url": "https://codeberg.org/meisam/woodpecktester/compare/main...28c3613ae62640216bea5e7dc71aa65356e4298b",
"commits": [],
"head_commit": {
"id": "28c3613ae62640216bea5e7dc71aa65356e4298b",
"message": "Delete '.woodpecker/.check.yml'\n",
"url": "https://codeberg.org/meisam/woodpecktester/commit/28c3613ae62640216bea5e7dc71aa65356e4298b",
"author": {
"name": "meisam",
"email": "meisam@noreply.codeberg.org",
"username": "meisam"
},
"committer": {
"name": "meisam",
"email": "meisam@noreply.codeberg.org",
"username": "meisam"
},
"verification": null,
"timestamp": "2022-07-12T21:09:27+02:00",
"added": [],
"removed": [
".woodpecker/.check.yml"
],
"modified": []
},
"repository": {
"id": 50820,
"owner": {
"id": 14844,
"login": "meisam",
"full_name": "",
"email": "meisam@noreply.codeberg.org",
"avatar_url": "https://codeberg.org/avatars/96512da76a14cf44e0bb32d1640e878e",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2020-10-08T11:19:12+02:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "Materials engineer, physics enthusiast, large collection of the bad programming habits, always happy to fix the old ones and make new mistakes!",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "meisam",
"permissions": {
"admin": true,
"push": true,
"pull": true
}
},
"name": "woodpecktester",
"full_name": "meisam/woodpecktester",
"description": "Just for testing the Woodpecker CI and reporting bugs",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 367,
"language": "",
"languages_url": "https://codeberg.org/api/v1/repos/meisam/woodpecktester/languages",
"html_url": "https://codeberg.org/meisam/woodpecktester",
"ssh_url": "git@codeberg.org:meisam/woodpecktester.git",
"clone_url": "https://codeberg.org/meisam/woodpecktester.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2022-07-04T00:34:39+02:00",
"updated_at": "2022-07-24T20:31:29+02:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"default_merge_style": "merge",
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
},
"pusher": {
"id": 2628,
"login": "6543",
"full_name": "",
"email": "6543@obermui.de",
"avatar_url": "https://codeberg.org/avatars/09a234c768cb9bca78f6b2f82d6af173",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2019-10-12T05:05:49+02:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"visibility": "public",
"followers_count": 22,
"following_count": 16,
"starred_repos_count": 55,
"username": "6543"
},
"sender": {
"id": 2628,
"login": "6543",
"full_name": "",
"email": "6543@obermui.de",
"avatar_url": "https://codeberg.org/avatars/09a234c768cb9bca78f6b2f82d6af173",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2019-10-12T05:05:49+02:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"visibility": "public",
"followers_count": 22,
"following_count": 16,
"starred_repos_count": 55,
"username": "6543"
}
}
`
// HookTag is a sample Gitea tag hook
const HookTag = `{
"sha": "ef98532add3b2feb7a137426bba1248724367df5",
"secret": "l26Un7G7HXogLAvsyf2hOA4EMARSTsR3",
"ref": "v1.0.0",
"ref_type": "tag",
"repository": {
"id": 1,
"owner": {
"id": 1,
"username": "gordon",
"login": "gordon",
"full_name": "Gordon the Gopher",
"email": "gordon@golang.org",
"avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
},
"name": "hello-world",
"full_name": "gordon/hello-world",
"description": "",
"private": true,
"fork": false,
"html_url": "http://gitea.golang.org/gordon/hello-world",
"ssh_url": "git@gitea.golang.org:gordon/hello-world.git",
"clone_url": "http://gitea.golang.org/gordon/hello-world.git",
"default_branch": "main",
"created_at": "2015-10-22T19:32:44Z",
"updated_at": "2016-11-24T13:37:16Z",
"permissions": {
"admin": true,
"push": true,
"pull": true
}
},
"sender": {
"id": 1,
"username": "gordon",
"login": "gordon",
"full_name": "Gordon the Gopher",
"email": "gordon@golang.org",
"avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
}
}`
// HookPullRequest is a sample pull_request webhook payload
const HookPullRequest = `{
"action": "opened",
"number": 1,
"pull_request": {
"html_url": "http://gitea.golang.org/gordon/hello-world/pull/1",
"state": "open",
"title": "Update the README with new information",
"body": "please merge",
"user": {
"id": 1,
"username": "gordon",
"login": "gordon",
"full_name": "Gordon the Gopher",
"email": "gordon@golang.org",
"avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
},
"base": {
"label": "main",
"ref": "main",
"sha": "9353195a19e45482665306e466c832c46560532d"
},
"head": {
"label": "feature/changes",
"ref": "feature/changes",
"sha": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c"
}
},
"repository": {
"id": 35129377,
"name": "hello-world",
"full_name": "gordon/hello-world",
"owner": {
"id": 1,
"username": "gordon",
"login": "gordon",
"full_name": "Gordon the Gopher",
"email": "gordon@golang.org",
"avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
},
"private": true,
"html_url": "http://gitea.golang.org/gordon/hello-world",
"clone_url": "https://gitea.golang.org/gordon/hello-world.git",
"default_branch": "main",
"permissions": {
"admin": true,
"push": true,
"pull": true
}
},
"sender": {
"id": 1,
"login": "gordon",
"username": "gordon",
"full_name": "Gordon the Gopher",
"email": "gordon@golang.org",
"avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
}
}`
const HookPullRequestMerged = `
{
"action": "closed",
"number": 1,
"pull_request": {
"id": 62112,
"url": "https://gitea.com/anbraten/test-repo/pulls/1",
"number": 1,
"user": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"title": "Adjust file",
"body": "",
"labels": [],
"milestone": null,
"assignee": null,
"assignees": null,
"requested_reviewers": null,
"state": "closed",
"is_locked": false,
"comments": 1,
"html_url": "https://gitea.com/anbraten/test-repo/pulls/1",
"diff_url": "https://gitea.com/anbraten/test-repo/pulls/1.diff",
"patch_url": "https://gitea.com/anbraten/test-repo/pulls/1.patch",
"mergeable": true,
"merged": true,
"merged_at": "2023-12-05T18:35:31Z",
"merge_commit_sha": "f2440f050054df0f8ecabcace648f1683509064c",
"merged_by": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"allow_maintainer_edit": false,
"base": {
"label": "main",
"ref": "main",
"sha": "f2440f050054df0f8ecabcace648f1683509064c",
"repo_id": 46534,
"repo": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
}
},
"head": {
"label": "anbraten-patch-1",
"ref": "anbraten-patch-1",
"sha": "d555a5dd07f4d0148a58d4686ec381502ae6a2d4",
"repo_id": 46534,
"repo": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
}
},
"merge_base": "068aee163ffd44eef28a7f9ebd43e2c01774f0fa",
"due_date": null,
"created_at": "2023-12-05T18:06:38Z",
"updated_at": "2023-12-05T18:35:31Z",
"closed_at": "2023-12-05T18:35:31Z",
"pin_order": 0
},
"requested_reviewer": null,
"repository": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
},
"sender": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"commit_id": "",
"review": null
}
`
const HookPullRequestClosed = `
{
"action": "closed",
"number": 1,
"pull_request": {
"id": 62112,
"url": "https://gitea.com/anbraten/test-repo/pulls/1",
"number": 1,
"user": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"title": "Adjust file",
"body": "",
"labels": [],
"milestone": null,
"assignee": null,
"assignees": null,
"requested_reviewers": null,
"state": "closed",
"is_locked": false,
"comments": 0,
"html_url": "https://gitea.com/anbraten/test-repo/pulls/1",
"diff_url": "https://gitea.com/anbraten/test-repo/pulls/1.diff",
"patch_url": "https://gitea.com/anbraten/test-repo/pulls/1.patch",
"mergeable": true,
"merged": false,
"merged_at": null,
"merge_commit_sha": null,
"merged_by": null,
"allow_maintainer_edit": false,
"base": {
"label": "main",
"ref": "main",
"sha": "068aee163ffd44eef28a7f9ebd43e2c01774f0fa",
"repo_id": 46534,
"repo": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
}
},
"head": {
"label": "anbraten-patch-1",
"ref": "anbraten-patch-1",
"sha": "d555a5dd07f4d0148a58d4686ec381502ae6a2d4",
"repo_id": 46534,
"repo": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
}
},
"merge_base": "068aee163ffd44eef28a7f9ebd43e2c01774f0fa",
"due_date": null,
"created_at": "2023-12-05T18:06:38Z",
"updated_at": "2023-12-05T18:06:43Z",
"closed_at": "2023-12-05T18:06:43Z",
"pin_order": 0
},
"requested_reviewer": null,
"repository": {
"id": 46534,
"owner": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"name": "test-repo",
"full_name": "anbraten/test-repo",
"description": "",
"empty": false,
"private": false,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 26,
"language": "",
"languages_url": "https://gitea.com/api/v1/repos/anbraten/test-repo/languages",
"html_url": "https://gitea.com/anbraten/test-repo",
"url": "https://gitea.com/api/v1/repos/anbraten/test-repo",
"link": "",
"ssh_url": "git@gitea.com:anbraten/test-repo.git",
"clone_url": "https://gitea.com/anbraten/test-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 1,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2023-12-05T18:03:55Z",
"updated_at": "2023-12-05T18:06:29Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"has_releases": true,
"has_packages": false,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null
},
"sender": {
"id": 26907,
"login": "anbraten",
"login_name": "",
"full_name": "",
"email": "anbraten@noreply.gitea.com",
"avatar_url": "https://seccdn.libravatar.org/avatar/fc9b6fe77c6b732a02925a62a81f05a0?d=identicon",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2021-07-19T23:21:52Z",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 1,
"username": "anbraten"
},
"commit_id": "",
"review": null
}
`
const HookRelease = `
{
"action": "published",
"release": {
"id": 48,
"tag_name": "0.0.5",
"target_commitish": "main",
"name": "Version 0.0.5",
"body": "",
"url": "https://git.xxx/api/v1/repos/anbraten/demo/releases/48",
"html_url": "https://git.xxx/anbraten/demo/releases/tag/0.0.5",
"tarball_url": "https://git.xxx/anbraten/demo/archive/0.0.5.tar.gz",
"zipball_url": "https://git.xxx/anbraten/demo/archive/0.0.5.zip",
"draft": false,
"prerelease": false,
"created_at": "2022-02-09T20:23:05Z",
"published_at": "2022-02-09T20:23:05Z",
"author": {"id":1,"login":"anbraten","full_name":"Anton Bracke","email":"anbraten@noreply.xxx","avatar_url":"https://git.xxx/user/avatar/anbraten/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-03-21T10:04:48Z","restricted":false,"active":false,"prohibit_login":false,"location":"world","website":"https://xxx","description":"","visibility":"public","followers_count":1,"following_count":1,"starred_repos_count":1,"username":"anbraten"},
"assets": []
},
"repository": {
"id": 77,
"owner": {"id":1,"login":"anbraten","full_name":"Anton Bracke","email":"anbraten@noreply.xxx","avatar_url":"https://git.xxx/user/avatar/anbraten/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-03-21T10:04:48Z","restricted":false,"active":false,"prohibit_login":false,"location":"world","website":"https://xxx","description":"","visibility":"public","followers_count":1,"following_count":1,"starred_repos_count":1,"username":"anbraten"},
"name": "demo",
"full_name": "anbraten/demo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 59,
"html_url": "https://git.xxx/anbraten/demo",
"ssh_url": "ssh://git@git.xxx:22/anbraten/demo.git",
"clone_url": "https://git.xxx/anbraten/demo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 1,
"watchers_count": 1,
"open_issues_count": 2,
"open_pr_counter": 2,
"release_counter": 4,
"default_branch": "main",
"archived": false,
"created_at": "2021-08-30T20:54:13Z",
"updated_at": "2022-01-09T01:29:23Z",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": false,
"has_pull_requests": true,
"has_projects": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"default_merge_style": "squash",
"avatar_url": "",
"internal": false,
"mirror_interval": ""
},
"sender": {"id":1,"login":"anbraten","full_name":"Anbraten","email":"anbraten@noreply.xxx","avatar_url":"https://git.xxx/user/avatar/anbraten/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-03-21T10:04:48Z","restricted":false,"active":false,"prohibit_login":false,"location":"World","website":"https://xxx","description":"","visibility":"public","followers_count":1,"following_count":1,"starred_repos_count":1,"username":"anbraten"}
}
`