diff --git a/README.md b/README.md index 2522a36..6298824 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,9 @@ octokit base: "main" /* optional: defaults to default branch */, update: false /* optional: set to `true` to enable updating existing pull requests */, forceFork: false /* optional: force creating fork even when user has write rights */, + labels: [ + "bug", + ] /* optional: applies the given labels when user has permissions. When updating an existing pull request, already present labels will not be deleted. */ changes: [ { /* optional: if `files` is not passed, an empty commit is created instead */ diff --git a/src/compose-create-pull-request.ts b/src/compose-create-pull-request.ts index 97acb4b..f00590f 100644 --- a/src/compose-create-pull-request.ts +++ b/src/compose-create-pull-request.ts @@ -16,6 +16,7 @@ export async function composeCreatePullRequest( createWhenEmpty, changes: changesOption, draft = false, + labels = [], forceFork = false, update = false, }: Options @@ -203,9 +204,10 @@ export async function composeCreatePullRequest( draft, }; + let res; if (existingPullRequest) { // https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request - return await octokit.request( + res = await octokit.request( "PATCH /repos/{owner}/{repo}/pulls/{pull_number}", { pull_number: existingPullRequest.number, @@ -214,9 +216,44 @@ export async function composeCreatePullRequest( ); } else { // https://developer.github.com/v3/pulls/#create-a-pull-request - return await octokit.request( + res = await octokit.request( "POST /repos/{owner}/{repo}/pulls", pullRequestOptions ); } + + if (labels.length) { + try { + const labelRes = await octokit.request( + "POST /repos/{owner}/{repo}/issues/{number}/labels", + { + owner, + repo, + number: res.data.number, + labels, + } + ); + + // istanbul ignore if + if (labelRes.data.length > labels.length) { + octokit.log.warn( + "The pull request already contains more labels than the ones provided. This could be due to the presence of previous labels." + ); + } + } catch (error) { + // @ts-ignore + // istanbul ignore if + if (error.status === 403) { + octokit.log.warn( + "You do not have permissions to apply labels to this pull request. However, the pull request has been successfully created without the requested labels." + ); + return res; + } + + // @ts-ignore + if (error.status !== 403) throw error; + } + } + + return res; } diff --git a/src/types.ts b/src/types.ts index 51c0d6a..396c6e6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,6 +11,7 @@ export type Options = { body: string; head: string; changes: Changes | Changes[]; + labels?: String[]; base?: string; createWhenEmpty?: boolean; draft?: boolean; diff --git a/test/fixtures/labels-with-error.json b/test/fixtures/labels-with-error.json new file mode 100644 index 0000000..bc81491 --- /dev/null +++ b/test/fixtures/labels-with-error.json @@ -0,0 +1,1089 @@ +[ + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}", + "owner": "gr2m", + "repo": "pull-request-test" + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"d1c1b3565de23378611062c9f75ae3ab70e1a8319ad2d63bee6d113b7c03462a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:09 GMT", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D0:6E39:BD128B:CAB8C9:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4942", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "58", + "x-xss-protection": "0" + }, + "data": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:21:12Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 3, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 3, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "network_count": 2, + "subscribers_count": 1 + } + } + }, + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "master", + "per_page": 1 + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits?sha=master&per_page=1", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"2fe2b7c39b2b80f77c8d03c07249ea7ce2e2135086205c5d4afe82ca68ce490e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:06 GMT", + "link": "; rel=\"next\", ; rel=\"last\"", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D3:2D3E:11FB109:127EF78:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4941", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "59", + "x-xss-protection": "0" + }, + "data": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "node_id": "MDY6Q29tbWl0MTYwOTg3NDkyOmRiNzRjOTdjNGQ1NjNkMWNkYzZiNzhjMmU0Nzg4NjA3MDNlODllZWM=", + "commit": { + "author": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "message": "docs(CODE_OF_CONDUCT): Contributor Covenant", + "tree": { + "sha": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/dbf6b9b90f659c225e8875e2569763c8dbdb7a8f" + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec/comments", + "author": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "committer": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "parents": [ + { + "sha": "b6cc0485d5157e05292f1a9d274836553964eb21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/b6cc0485d5157e05292f1a9d274836553964eb21", + "html_url": "https://github.com/gr2m/pull-request-test/commit/b6cc0485d5157e05292f1a9d274836553964eb21" + } + ] + } + ] + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/trees", + "owner": "gr2m", + "repo": "pull-request-test", + "base_tree": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "tree": [ + { + "path": "path/to/file1.txt", + "mode": "100644", + "content": "Content for file1" + }, + { + "path": "path/to/file2.txt", + "mode": "100644", + "content": "Content for file2" + } + ] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1276", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"0bb6a860fc5484ea3c49bf88252b28d03126f2f82d2d9f7440cac97e4eaa252e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D8:5D60:EF593:19AD28:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4940", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "60", + "x-xss-protection": "0" + }, + "data": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "tree": [ + { + "path": ".github", + "mode": "040000", + "type": "tree", + "sha": "59f80b89b889df8e8d9fb24da009732c8b21ab8a", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/59f80b89b889df8e8d9fb24da009732c8b21ab8a" + }, + { + "path": "CODE_OF_CONDUCT.md", + "mode": "100644", + "type": "blob", + "sha": "dad5ddc09aca02e99a3b46501cf1a439df9ff6ad", + "size": 3240, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/dad5ddc09aca02e99a3b46501cf1a439df9ff6ad" + }, + { + "path": "README.md", + "mode": "100644", + "type": "blob", + "sha": "5e84a7b5aca35bfb47b8847e90c30ffdb1714db8", + "size": 196, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/5e84a7b5aca35bfb47b8847e90c30ffdb1714db8" + }, + { + "path": "path", + "mode": "040000", + "type": "tree", + "sha": "a86275422c16c0c9150338319cb16e5da5046e21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/a86275422c16c0c9150338319cb16e5da5046e21" + }, + { + "path": "test.txt", + "mode": "100644", + "type": "blob", + "sha": "9daeafb9864cf43055ae93beb0afd6c7d144bfa4", + "size": 5, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/9daeafb9864cf43055ae93beb0afd6c7d144bfa4" + } + ], + "truncated": false + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "message": "why", + "tree": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "parents": ["db74c97c4d563d1cdc6b78c2e478860703e89eec"] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1125", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"b6e43cade5ac862812ec2304e903f84da45b534aefcd869fa36e0408b78f0248\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DB:7764:465EA5:520B05:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4939", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "61", + "x-xss-protection": "0" + }, + "data": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "node_id": "C_kwDOCZh5ZNoAKDkzNmYzMTQxNTc5NzBlMGE0MmZmM2FmMzVlMzNiMDlkYzEzMzMxZTk", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "html_url": "https://github.com/gr2m/pull-request-test/commit/936f314157970e0a42ff3af35e33b09dc13331e9", + "author": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "tree": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b" + }, + "message": "why", + "parents": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/graphql", + "query": "\n query ($owner: String!, $repo: String!, $head: String!) {\n repository(name: $repo, owner: $owner) {\n ref(qualifiedName: $head) {\n associatedPullRequests(first: 1, states: OPEN) {\n edges {\n node {\n id\n number\n url\n }\n }\n }\n }\n }\n }", + "variables": { + "owner": "gr2m", + "repo": "pull-request-test", + "head": "with-labels" + } + }, + "response": { + "status": 200, + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:15 GMT", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DE:6E39:BD13CA:CABA0B:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-poll-interval": "300", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4938", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "62", + "x-xss-protection": "0" + }, + "data": { + "data": { + "repository": { + "ref": null + } + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/refs", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "ref": "refs/heads/with-labels" + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "371", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:16 GMT", + "etag": "\"4ae770bbe12eb804829c13236b29477ee1541122eef356a6745ef8dddbd724f4\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E1:8409:AE9AA4:BC415C:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4937", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "63", + "x-xss-protection": "0" + }, + "data": { + "ref": "refs/heads/with-labels", + "node_id": "MDM6UmVmMTYwOTg3NDkyOnJlZnMvaGVhZHMvaGFwcHktcGF0aA==", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "object": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "type": "commit", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9" + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/pulls", + "owner": "gr2m", + "repo": "pull-request-test", + "head": "gr2m:with-labels", + "base": "master", + "title": "One comes, one goes", + "body": "because", + "draft": false + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "14924", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:17 GMT", + "etag": "\"e483d03319f084ede850ae7df26e05bf2f8c26c1fb4ea58add3df72c8fc0c75a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E4:301C:2DEDE1:39237D:62BA49B8", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4936", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "64", + "x-xss-protection": "0" + }, + "data": { + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "id": 980762574, + "node_id": "PR_kwDOCZh5ZM46dT_O", + "html_url": "https://github.com/gr2m/pull-request-test/pull/87", + "diff_url": "https://github.com/gr2m/pull-request-test/pull/87.diff", + "patch_url": "https://github.com/gr2m/pull-request-test/pull/87.patch", + "issue_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87", + "number": 87, + "state": "open", + "locked": false, + "title": "One comes, one goes", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "body": "because", + "created_at": "2022-06-28T00:22:16Z", + "updated_at": "2022-06-28T00:22:16Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits", + "review_comments_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments", + "review_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9", + "head": { + "label": "gr2m:with-labels", + "ref": "with-labels", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "gr2m:master", + "ref": "master", + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87" + }, + "html": { + "href": "https://github.com/gr2m/pull-request-test/pull/87" + }, + "issue": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87" + }, + "comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9" + } + }, + "author_association": "OWNER", + "auto_merge": null, + "active_lock_reason": null, + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 2 + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/4.1.0 Node.js/18.15.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/issues/{number}/labels", + "owner": "gr2m", + "repo": "pull-request-test", + "number": 87, + "labels": [ + "enhancement", + "help wanted" + ] + }, + "response": { + "status": 404, + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Sun, 04 Jun 2023 21:23:51 GMT", + "github-authentication-token-expiration": "2023-07-04 20:58:49 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "2022-11-28", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "A0E7:0BAC:16E76F27:171F47F0:647D00E6", + "x-oauth-scopes": "repo", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4890", + "x-ratelimit-reset": "1685915949", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "110", + "x-xss-protection": "0" + }, + "data": { + "error": "Not Found" + } + } + } +] diff --git a/test/fixtures/labels-without-permissions.json b/test/fixtures/labels-without-permissions.json new file mode 100644 index 0000000..5972e62 --- /dev/null +++ b/test/fixtures/labels-without-permissions.json @@ -0,0 +1,1089 @@ +[ + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}", + "owner": "gr2m", + "repo": "pull-request-test" + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"d1c1b3565de23378611062c9f75ae3ab70e1a8319ad2d63bee6d113b7c03462a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:09 GMT", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D0:6E39:BD128B:CAB8C9:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4942", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "58", + "x-xss-protection": "0" + }, + "data": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:21:12Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 3, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 3, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "network_count": 2, + "subscribers_count": 1 + } + } + }, + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "master", + "per_page": 1 + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits?sha=master&per_page=1", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"2fe2b7c39b2b80f77c8d03c07249ea7ce2e2135086205c5d4afe82ca68ce490e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:06 GMT", + "link": "; rel=\"next\", ; rel=\"last\"", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D3:2D3E:11FB109:127EF78:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4941", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "59", + "x-xss-protection": "0" + }, + "data": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "node_id": "MDY6Q29tbWl0MTYwOTg3NDkyOmRiNzRjOTdjNGQ1NjNkMWNkYzZiNzhjMmU0Nzg4NjA3MDNlODllZWM=", + "commit": { + "author": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "message": "docs(CODE_OF_CONDUCT): Contributor Covenant", + "tree": { + "sha": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/dbf6b9b90f659c225e8875e2569763c8dbdb7a8f" + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec/comments", + "author": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "committer": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "parents": [ + { + "sha": "b6cc0485d5157e05292f1a9d274836553964eb21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/b6cc0485d5157e05292f1a9d274836553964eb21", + "html_url": "https://github.com/gr2m/pull-request-test/commit/b6cc0485d5157e05292f1a9d274836553964eb21" + } + ] + } + ] + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/trees", + "owner": "gr2m", + "repo": "pull-request-test", + "base_tree": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "tree": [ + { + "path": "path/to/file1.txt", + "mode": "100644", + "content": "Content for file1" + }, + { + "path": "path/to/file2.txt", + "mode": "100644", + "content": "Content for file2" + } + ] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1276", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"0bb6a860fc5484ea3c49bf88252b28d03126f2f82d2d9f7440cac97e4eaa252e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D8:5D60:EF593:19AD28:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4940", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "60", + "x-xss-protection": "0" + }, + "data": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "tree": [ + { + "path": ".github", + "mode": "040000", + "type": "tree", + "sha": "59f80b89b889df8e8d9fb24da009732c8b21ab8a", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/59f80b89b889df8e8d9fb24da009732c8b21ab8a" + }, + { + "path": "CODE_OF_CONDUCT.md", + "mode": "100644", + "type": "blob", + "sha": "dad5ddc09aca02e99a3b46501cf1a439df9ff6ad", + "size": 3240, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/dad5ddc09aca02e99a3b46501cf1a439df9ff6ad" + }, + { + "path": "README.md", + "mode": "100644", + "type": "blob", + "sha": "5e84a7b5aca35bfb47b8847e90c30ffdb1714db8", + "size": 196, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/5e84a7b5aca35bfb47b8847e90c30ffdb1714db8" + }, + { + "path": "path", + "mode": "040000", + "type": "tree", + "sha": "a86275422c16c0c9150338319cb16e5da5046e21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/a86275422c16c0c9150338319cb16e5da5046e21" + }, + { + "path": "test.txt", + "mode": "100644", + "type": "blob", + "sha": "9daeafb9864cf43055ae93beb0afd6c7d144bfa4", + "size": 5, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/9daeafb9864cf43055ae93beb0afd6c7d144bfa4" + } + ], + "truncated": false + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "message": "why", + "tree": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "parents": ["db74c97c4d563d1cdc6b78c2e478860703e89eec"] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1125", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"b6e43cade5ac862812ec2304e903f84da45b534aefcd869fa36e0408b78f0248\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DB:7764:465EA5:520B05:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4939", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "61", + "x-xss-protection": "0" + }, + "data": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "node_id": "C_kwDOCZh5ZNoAKDkzNmYzMTQxNTc5NzBlMGE0MmZmM2FmMzVlMzNiMDlkYzEzMzMxZTk", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "html_url": "https://github.com/gr2m/pull-request-test/commit/936f314157970e0a42ff3af35e33b09dc13331e9", + "author": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "tree": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b" + }, + "message": "why", + "parents": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/graphql", + "query": "\n query ($owner: String!, $repo: String!, $head: String!) {\n repository(name: $repo, owner: $owner) {\n ref(qualifiedName: $head) {\n associatedPullRequests(first: 1, states: OPEN) {\n edges {\n node {\n id\n number\n url\n }\n }\n }\n }\n }\n }", + "variables": { + "owner": "gr2m", + "repo": "pull-request-test", + "head": "with-labels" + } + }, + "response": { + "status": 200, + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:15 GMT", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DE:6E39:BD13CA:CABA0B:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-poll-interval": "300", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4938", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "62", + "x-xss-protection": "0" + }, + "data": { + "data": { + "repository": { + "ref": null + } + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/refs", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "ref": "refs/heads/with-labels" + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "371", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:16 GMT", + "etag": "\"4ae770bbe12eb804829c13236b29477ee1541122eef356a6745ef8dddbd724f4\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E1:8409:AE9AA4:BC415C:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4937", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "63", + "x-xss-protection": "0" + }, + "data": { + "ref": "refs/heads/with-labels", + "node_id": "MDM6UmVmMTYwOTg3NDkyOnJlZnMvaGVhZHMvaGFwcHktcGF0aA==", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "object": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "type": "commit", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9" + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/pulls", + "owner": "gr2m", + "repo": "pull-request-test", + "head": "gr2m:with-labels", + "base": "master", + "title": "One comes, one goes", + "body": "because", + "draft": false + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "14924", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:17 GMT", + "etag": "\"e483d03319f084ede850ae7df26e05bf2f8c26c1fb4ea58add3df72c8fc0c75a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E4:301C:2DEDE1:39237D:62BA49B8", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4936", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "64", + "x-xss-protection": "0" + }, + "data": { + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "id": 980762574, + "node_id": "PR_kwDOCZh5ZM46dT_O", + "html_url": "https://github.com/gr2m/pull-request-test/pull/87", + "diff_url": "https://github.com/gr2m/pull-request-test/pull/87.diff", + "patch_url": "https://github.com/gr2m/pull-request-test/pull/87.patch", + "issue_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87", + "number": 87, + "state": "open", + "locked": false, + "title": "One comes, one goes", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "body": "because", + "created_at": "2022-06-28T00:22:16Z", + "updated_at": "2022-06-28T00:22:16Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits", + "review_comments_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments", + "review_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9", + "head": { + "label": "gr2m:with-labels", + "ref": "with-labels", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "gr2m:master", + "ref": "master", + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87" + }, + "html": { + "href": "https://github.com/gr2m/pull-request-test/pull/87" + }, + "issue": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87" + }, + "comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9" + } + }, + "author_association": "OWNER", + "auto_merge": null, + "active_lock_reason": null, + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 2 + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/4.1.0 Node.js/18.15.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/issues/{number}/labels", + "owner": "gr2m", + "repo": "pull-request-test", + "number": 87, + "labels": [ + "enhancement", + "help wanted" + ] + }, + "response": { + "status": 403, + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Sun, 04 Jun 2023 21:23:51 GMT", + "github-authentication-token-expiration": "2023-07-04 20:58:49 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "2022-11-28", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "A0E7:0BAC:16E76F27:171F47F0:647D00E6", + "x-oauth-scopes": "repo", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4890", + "x-ratelimit-reset": "1685915949", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "110", + "x-xss-protection": "0" + }, + "data": { + "error": "Must have admin rights to Repository." + } + } + } +] diff --git a/test/fixtures/labels.json b/test/fixtures/labels.json new file mode 100644 index 0000000..6fe185b --- /dev/null +++ b/test/fixtures/labels.json @@ -0,0 +1,1109 @@ +[ + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}", + "owner": "gr2m", + "repo": "pull-request-test" + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"d1c1b3565de23378611062c9f75ae3ab70e1a8319ad2d63bee6d113b7c03462a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:09 GMT", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D0:6E39:BD128B:CAB8C9:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4942", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "58", + "x-xss-protection": "0" + }, + "data": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:21:12Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 3, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 3, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": true, + "allow_update_branch": false, + "use_squash_pr_title_as_default": true, + "network_count": 2, + "subscribers_count": 1 + } + } + }, + { + "request": { + "method": "GET", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "master", + "per_page": 1 + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits?sha=master&per_page=1", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:13 GMT", + "etag": "W/\"2fe2b7c39b2b80f77c8d03c07249ea7ce2e2135086205c5d4afe82ca68ce490e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "last-modified": "Thu, 15 Oct 2020 00:04:06 GMT", + "link": "; rel=\"next\", ; rel=\"last\"", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D3:2D3E:11FB109:127EF78:62BA49B5", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4941", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "59", + "x-xss-protection": "0" + }, + "data": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "node_id": "MDY6Q29tbWl0MTYwOTg3NDkyOmRiNzRjOTdjNGQ1NjNkMWNkYzZiNzhjMmU0Nzg4NjA3MDNlODllZWM=", + "commit": { + "author": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "gregor@martynus.net", + "date": "2020-10-15T00:04:06Z" + }, + "message": "docs(CODE_OF_CONDUCT): Contributor Covenant", + "tree": { + "sha": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/dbf6b9b90f659c225e8875e2569763c8dbdb7a8f" + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + }, + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec/comments", + "author": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "committer": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "parents": [ + { + "sha": "b6cc0485d5157e05292f1a9d274836553964eb21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/commits/b6cc0485d5157e05292f1a9d274836553964eb21", + "html_url": "https://github.com/gr2m/pull-request-test/commit/b6cc0485d5157e05292f1a9d274836553964eb21" + } + ] + } + ] + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/trees", + "owner": "gr2m", + "repo": "pull-request-test", + "base_tree": "dbf6b9b90f659c225e8875e2569763c8dbdb7a8f", + "tree": [ + { + "path": "path/to/file1.txt", + "mode": "100644", + "content": "Content for file1" + }, + { + "path": "path/to/file2.txt", + "mode": "100644", + "content": "Content for file2" + } + ] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1276", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"0bb6a860fc5484ea3c49bf88252b28d03126f2f82d2d9f7440cac97e4eaa252e\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9D8:5D60:EF593:19AD28:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4940", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "60", + "x-xss-protection": "0" + }, + "data": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "tree": [ + { + "path": ".github", + "mode": "040000", + "type": "tree", + "sha": "59f80b89b889df8e8d9fb24da009732c8b21ab8a", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/59f80b89b889df8e8d9fb24da009732c8b21ab8a" + }, + { + "path": "CODE_OF_CONDUCT.md", + "mode": "100644", + "type": "blob", + "sha": "dad5ddc09aca02e99a3b46501cf1a439df9ff6ad", + "size": 3240, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/dad5ddc09aca02e99a3b46501cf1a439df9ff6ad" + }, + { + "path": "README.md", + "mode": "100644", + "type": "blob", + "sha": "5e84a7b5aca35bfb47b8847e90c30ffdb1714db8", + "size": 196, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/5e84a7b5aca35bfb47b8847e90c30ffdb1714db8" + }, + { + "path": "path", + "mode": "040000", + "type": "tree", + "sha": "a86275422c16c0c9150338319cb16e5da5046e21", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/a86275422c16c0c9150338319cb16e5da5046e21" + }, + { + "path": "test.txt", + "mode": "100644", + "type": "blob", + "sha": "9daeafb9864cf43055ae93beb0afd6c7d144bfa4", + "size": 5, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs/9daeafb9864cf43055ae93beb0afd6c7d144bfa4" + } + ], + "truncated": false + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/commits", + "owner": "gr2m", + "repo": "pull-request-test", + "message": "why", + "tree": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "parents": ["db74c97c4d563d1cdc6b78c2e478860703e89eec"] + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "1125", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:14 GMT", + "etag": "\"b6e43cade5ac862812ec2304e903f84da45b534aefcd869fa36e0408b78f0248\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DB:7764:465EA5:520B05:62BA49B6", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4939", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "61", + "x-xss-protection": "0" + }, + "data": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "node_id": "C_kwDOCZh5ZNoAKDkzNmYzMTQxNTc5NzBlMGE0MmZmM2FmMzVlMzNiMDlkYzEzMzMxZTk", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9", + "html_url": "https://github.com/gr2m/pull-request-test/commit/936f314157970e0a42ff3af35e33b09dc13331e9", + "author": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "committer": { + "name": "Gregor Martynus", + "email": "39992+gr2m@users.noreply.github.com", + "date": "2022-06-28T00:22:14Z" + }, + "tree": { + "sha": "16a9a22cf7ac9b7b20d858e585136cd77818e54b", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees/16a9a22cf7ac9b7b20d858e585136cd77818e54b" + }, + "message": "why", + "parents": [ + { + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/db74c97c4d563d1cdc6b78c2e478860703e89eec", + "html_url": "https://github.com/gr2m/pull-request-test/commit/db74c97c4d563d1cdc6b78c2e478860703e89eec" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/graphql", + "query": "\n query ($owner: String!, $repo: String!, $head: String!) {\n repository(name: $repo, owner: $owner) {\n ref(qualifiedName: $head) {\n associatedPullRequests(first: 1, states: OPEN) {\n edges {\n node {\n id\n number\n url\n }\n }\n }\n }\n }\n }", + "variables": { + "owner": "gr2m", + "repo": "pull-request-test", + "head": "with-labels" + } + }, + "response": { + "status": 200, + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "connection": "close", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:15 GMT", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9DE:6E39:BD13CA:CABA0B:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-poll-interval": "300", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4938", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "62", + "x-xss-protection": "0" + }, + "data": { + "data": { + "repository": { + "ref": null + } + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/git/refs", + "owner": "gr2m", + "repo": "pull-request-test", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "ref": "refs/heads/with-labels" + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "371", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:16 GMT", + "etag": "\"4ae770bbe12eb804829c13236b29477ee1541122eef356a6745ef8dddbd724f4\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "repo", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E1:8409:AE9AA4:BC415C:62BA49B7", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4937", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "63", + "x-xss-protection": "0" + }, + "data": { + "ref": "refs/heads/with-labels", + "node_id": "MDM6UmVmMTYwOTg3NDkyOnJlZnMvaGVhZHMvaGFwcHktcGF0aA==", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs/heads/with-labels", + "object": { + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "type": "commit", + "url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits/936f314157970e0a42ff3af35e33b09dc13331e9" + } + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/3.2.5 Node.js/18.3.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/pulls", + "owner": "gr2m", + "repo": "pull-request-test", + "head": "gr2m:with-labels", + "base": "master", + "title": "One comes, one goes", + "body": "because", + "draft": false + }, + "response": { + "status": 201, + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "connection": "close", + "content-length": "14924", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 28 Jun 2022 00:22:17 GMT", + "etag": "\"e483d03319f084ede850ae7df26e05bf2f8c26c1fb4ea58add3df72c8fc0c75a\"", + "github-authentication-token-expiration": "2022-08-24 23:46:54 UTC", + "location": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "", + "x-github-api-version-selected-reason": "unavailable", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "F9E4:301C:2DEDE1:39237D:62BA49B8", + "x-oauth-scopes": "notifications, repo, workflow, write:org", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4936", + "x-ratelimit-reset": "1656378677", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "64", + "x-xss-protection": "0" + }, + "data": { + "url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87", + "id": 980762574, + "node_id": "PR_kwDOCZh5ZM46dT_O", + "html_url": "https://github.com/gr2m/pull-request-test/pull/87", + "diff_url": "https://github.com/gr2m/pull-request-test/pull/87.diff", + "patch_url": "https://github.com/gr2m/pull-request-test/pull/87.patch", + "issue_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87", + "number": 87, + "state": "open", + "locked": false, + "title": "One comes, one goes", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "body": "because", + "created_at": "2022-06-28T00:22:16Z", + "updated_at": "2022-06-28T00:22:16Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": null, + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits", + "review_comments_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments", + "review_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9", + "head": { + "label": "gr2m:with-labels", + "ref": "with-labels", + "sha": "936f314157970e0a42ff3af35e33b09dc13331e9", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "gr2m:master", + "ref": "master", + "sha": "db74c97c4d563d1cdc6b78c2e478860703e89eec", + "user": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "repo": { + "id": 160987492, + "node_id": "MDEwOlJlcG9zaXRvcnkxNjA5ODc0OTI=", + "name": "pull-request-test", + "full_name": "gr2m/pull-request-test", + "private": false, + "owner": { + "login": "gr2m", + "id": 39992, + "node_id": "MDQ6VXNlcjM5OTky", + "avatar_url": "https://avatars.githubusercontent.com/u/39992?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gr2m", + "html_url": "https://github.com/gr2m", + "followers_url": "https://api.github.com/users/gr2m/followers", + "following_url": "https://api.github.com/users/gr2m/following{/other_user}", + "gists_url": "https://api.github.com/users/gr2m/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gr2m/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gr2m/subscriptions", + "organizations_url": "https://api.github.com/users/gr2m/orgs", + "repos_url": "https://api.github.com/users/gr2m/repos", + "events_url": "https://api.github.com/users/gr2m/events{/privacy}", + "received_events_url": "https://api.github.com/users/gr2m/received_events", + "type": "User", + "site_admin": true + }, + "html_url": "https://github.com/gr2m/pull-request-test", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gr2m/pull-request-test", + "forks_url": "https://api.github.com/repos/gr2m/pull-request-test/forks", + "keys_url": "https://api.github.com/repos/gr2m/pull-request-test/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gr2m/pull-request-test/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gr2m/pull-request-test/teams", + "hooks_url": "https://api.github.com/repos/gr2m/pull-request-test/hooks", + "issue_events_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/events{/number}", + "events_url": "https://api.github.com/repos/gr2m/pull-request-test/events", + "assignees_url": "https://api.github.com/repos/gr2m/pull-request-test/assignees{/user}", + "branches_url": "https://api.github.com/repos/gr2m/pull-request-test/branches{/branch}", + "tags_url": "https://api.github.com/repos/gr2m/pull-request-test/tags", + "blobs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gr2m/pull-request-test/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gr2m/pull-request-test/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gr2m/pull-request-test/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gr2m/pull-request-test/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gr2m/pull-request-test/languages", + "stargazers_url": "https://api.github.com/repos/gr2m/pull-request-test/stargazers", + "contributors_url": "https://api.github.com/repos/gr2m/pull-request-test/contributors", + "subscribers_url": "https://api.github.com/repos/gr2m/pull-request-test/subscribers", + "subscription_url": "https://api.github.com/repos/gr2m/pull-request-test/subscription", + "commits_url": "https://api.github.com/repos/gr2m/pull-request-test/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gr2m/pull-request-test/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gr2m/pull-request-test/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gr2m/pull-request-test/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gr2m/pull-request-test/contents/{+path}", + "compare_url": "https://api.github.com/repos/gr2m/pull-request-test/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gr2m/pull-request-test/merges", + "archive_url": "https://api.github.com/repos/gr2m/pull-request-test/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gr2m/pull-request-test/downloads", + "issues_url": "https://api.github.com/repos/gr2m/pull-request-test/issues{/number}", + "pulls_url": "https://api.github.com/repos/gr2m/pull-request-test/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gr2m/pull-request-test/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gr2m/pull-request-test/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gr2m/pull-request-test/labels{/name}", + "releases_url": "https://api.github.com/repos/gr2m/pull-request-test/releases{/id}", + "deployments_url": "https://api.github.com/repos/gr2m/pull-request-test/deployments", + "created_at": "2018-12-08T23:26:26Z", + "updated_at": "2020-10-15T00:04:09Z", + "pushed_at": "2022-06-28T00:22:16Z", + "git_url": "git://github.com/gr2m/pull-request-test.git", + "ssh_url": "git@github.com:gr2m/pull-request-test.git", + "clone_url": "https://github.com/gr2m/pull-request-test.git", + "svn_url": "https://github.com/gr2m/pull-request-test", + "homepage": null, + "size": 11, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 4, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 4, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87" + }, + "html": { + "href": "https://github.com/gr2m/pull-request-test/pull/87" + }, + "issue": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87" + }, + "comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/issues/87/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/pulls/87/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/gr2m/pull-request-test/statuses/936f314157970e0a42ff3af35e33b09dc13331e9" + } + }, + "author_association": "OWNER", + "auto_merge": null, + "active_lock_reason": null, + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 0, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 1, + "additions": 2, + "deletions": 2, + "changed_files": 2 + } + } + }, + { + "request": { + "method": "POST", + "baseUrl": "https://api.github.com", + "headers": { + "accept": "application/vnd.github.v3+json", + "user-agent": "octokit-core.js/4.1.0 Node.js/18.15.0 (darwin; arm64)" + }, + "mediaType": { + "format": "", + "previews": [] + }, + "request": {}, + "url": "/repos/{owner}/{repo}/issues/{number}/labels", + "owner": "gr2m", + "repo": "pull-request-test", + "number": 87, + "labels": [ + "enhancement", + "help wanted" + ] + }, + "response": { + "status": 200, + "url": "https://api.github.com/repos/gr2m/pull-request-test/issues/1/labels", + "headers": { + "access-control-allow-origin": "*", + "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "cache-control": "private, max-age=60, s-maxage=60", + "content-encoding": "gzip", + "content-security-policy": "default-src 'none'", + "content-type": "application/json; charset=utf-8", + "date": "Sun, 04 Jun 2023 21:24:45 GMT", + "etag": "W/\"8a6c6b2363444efdbcb2276e6518c772c472614395c0aa30d65560e91792760d\"", + "github-authentication-token-expiration": "2023-07-04 20:58:49 UTC", + "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "server": "GitHub.com", + "strict-transport-security": "max-age=31536000; includeSubdomains; preload", + "transfer-encoding": "chunked", + "vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With", + "x-accepted-oauth-scopes": "", + "x-content-type-options": "nosniff", + "x-frame-options": "deny", + "x-github-api-version-selected": "2022-11-28", + "x-github-media-type": "github.v3; format=json", + "x-github-request-id": "A0C5:AA88:78A4B12:7A2CFD2:647D011B", + "x-oauth-scopes": "repo", + "x-ratelimit-limit": "5000", + "x-ratelimit-remaining": "4883", + "x-ratelimit-reset": "1685915949", + "x-ratelimit-resource": "core", + "x-ratelimit-used": "117", + "x-xss-protection": "0" + }, + "data": [ + { + "id": 5581569539, + "node_id": "LA_kwDOJrW-K88AAAABTK_-Aw", + "url": "https://api.github.com/repos/gr2m/pull-request-test/labels/enhancement", + "name": "enhancement", + "color": "a2eeef", + "default": true, + "description": "New feature or request" + }, + { + "id": 5581569540, + "node_id": "LA_kwDOJrW-K88AAAABTK_-BA", + "url": "https://api.github.com/repos/gr2m/pull-request-test/labels/help%20wanted", + "name": "help wanted", + "color": "008672", + "default": true, + "description": "Extra attention is needed" + } + ] + } + } +] diff --git a/test/labels-with-error.test.ts b/test/labels-with-error.test.ts new file mode 100644 index 0000000..5900339 --- /dev/null +++ b/test/labels-with-error.test.ts @@ -0,0 +1,62 @@ +import { Octokit as Core } from "@octokit/core"; +import { RequestError } from "@octokit/request-error"; + +import { createPullRequest } from "../src"; +const Octokit = Core.plugin(createPullRequest); + +test("labels without error", async () => { + const fixtures = require("./fixtures/labels-with-error"); + const fixturePr = fixtures[fixtures.length - 2].response; + const octokit = new Octokit(); + + octokit.hook.wrap("request", (_, options) => { + const currentFixtures = fixtures.shift(); + const { + baseUrl, + method, + url, + request, + headers, + mediaType, + draft, + ...params + } = options; + + expect( + `${currentFixtures.request.method} ${currentFixtures.request.url}` + ).toEqual(`${options.method} ${options.url}`); + + Object.keys(params).forEach((paramName) => { + expect(currentFixtures.request[paramName]).toStrictEqual( + params[paramName] + ); + }); + + if (currentFixtures.response.status >= 400) { + throw new RequestError("Error", currentFixtures.response.status, { + request: currentFixtures.request, + headers: currentFixtures.response.headers, + }); + } + + return currentFixtures.response; + }); + + expect(async () => { + return octokit.createPullRequest({ + owner: "gr2m", + repo: "pull-request-test", + title: "One comes, one goes", + body: "because", + labels: ["enhancement", "help wanted"], + head: "with-labels", + changes: { + files: { + "path/to/file1.txt": "Content for file1", + "path/to/file2.txt": "Content for file2", + }, + commit: "why", + }, + }); + }).rejects.toThrow(new Error("Error")); +}); diff --git a/test/labels-without-permissions.test.ts b/test/labels-without-permissions.test.ts new file mode 100644 index 0000000..2464862 --- /dev/null +++ b/test/labels-without-permissions.test.ts @@ -0,0 +1,63 @@ +import { Octokit as Core } from "@octokit/core"; +import { RequestError } from "@octokit/request-error"; + +import { createPullRequest } from "../src"; +const Octokit = Core.plugin(createPullRequest); + +test("labels without permissions", async () => { + const fixtures = require("./fixtures/labels-without-permissions"); + const fixturePr = fixtures[fixtures.length - 2].response; + const octokit = new Octokit(); + + octokit.hook.wrap("request", (_, options) => { + const currentFixtures = fixtures.shift(); + const { + baseUrl, + method, + url, + request, + headers, + mediaType, + draft, + ...params + } = options; + + expect( + `${currentFixtures.request.method} ${currentFixtures.request.url}` + ).toEqual(`${options.method} ${options.url}`); + + Object.keys(params).forEach((paramName) => { + expect(currentFixtures.request[paramName]).toStrictEqual( + params[paramName] + ); + }); + + if (currentFixtures.response.status >= 400) { + throw new RequestError("Error", currentFixtures.response.status, { + request: currentFixtures.request, + headers: currentFixtures.response.headers, + }); + } + + return currentFixtures.response; + }); + + const pr = await octokit.createPullRequest({ + owner: "gr2m", + repo: "pull-request-test", + title: "One comes, one goes", + body: "because", + labels: ["enhancement", "help wanted"], + head: "with-labels", + changes: { + files: { + "path/to/file1.txt": "Content for file1", + "path/to/file2.txt": "Content for file2", + }, + commit: "why", + }, + }); + + expect(pr).toStrictEqual(fixturePr); + expect(fixtures.length).toEqual(0); +}); diff --git a/test/labels.test.ts b/test/labels.test.ts new file mode 100644 index 0000000..5d69bd9 --- /dev/null +++ b/test/labels.test.ts @@ -0,0 +1,63 @@ +import { Octokit as Core } from "@octokit/core"; +import { RequestError } from "@octokit/request-error"; + +import { createPullRequest } from "../src"; +const Octokit = Core.plugin(createPullRequest); + +test("labels", async () => { + const fixtures = require("./fixtures/labels"); + const fixturePr = fixtures[fixtures.length - 2].response; + const octokit = new Octokit(); + + octokit.hook.wrap("request", (_, options) => { + const currentFixtures = fixtures.shift(); + const { + baseUrl, + method, + url, + request, + headers, + mediaType, + draft, + ...params + } = options; + + expect( + `${currentFixtures.request.method} ${currentFixtures.request.url}` + ).toEqual(`${options.method} ${options.url}`); + + Object.keys(params).forEach((paramName) => { + expect(currentFixtures.request[paramName]).toStrictEqual( + params[paramName] + ); + }); + + if (currentFixtures.response.status >= 400) { + throw new RequestError("Error", currentFixtures.response.status, { + request: currentFixtures.request, + headers: currentFixtures.response.headers, + }); + } + + return currentFixtures.response; + }); + + const pr = await octokit.createPullRequest({ + owner: "gr2m", + repo: "pull-request-test", + title: "One comes, one goes", + body: "because", + labels: ["enhancement", "help wanted"], + head: "with-labels", + changes: { + files: { + "path/to/file1.txt": "Content for file1", + "path/to/file2.txt": "Content for file2", + }, + commit: "why", + }, + }); + + expect(pr).toStrictEqual(fixturePr); + expect(fixtures.length).toEqual(0); +});