Upgrade rustls to 0.23.46 #39
Approved by syntaqx
153 files+104−1630137 files not counted0/153 viewed
| 3398 | 3398 | ||
| 3399 | 3399 | [[package]] | |
| 3400 | 3400 | name = "rustls" | |
| 3401 | − | version = "0.23.45" | |
| 3401 | + | version = "0.23.46" | |
| 3402 | 3402 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3403 | − | checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" | |
| 3403 | + | checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" | |
| 3404 | 3404 | dependencies = [ | |
| 3405 | 3405 | "aws-lc-rs", | |
| 3406 | 3406 | "log", |
| 132 | 132 | Op::ArchiveRepo, | |
| 133 | 133 | Op::UnarchiveRepo, | |
| 134 | 134 | Op::TransferRepo, | |
| 135 | − | Op::ForkRepo, | |
| 136 | − | Op::ListForks, | |
| 137 | − | Op::SyncFork, | |
| 138 | − | Op::DetachFork, | |
| 139 | 135 | Op::DeleteRepo, | |
| 140 | 136 | Op::ListDeletedRepos, | |
| 141 | 137 | Op::RestoreRepo, | |
| ⋯ | |||
| 145 | 141 | Op::ListCheckNames, | |
| 146 | 142 | Op::GetCodeownersErrors, | |
| 147 | 143 | Op::ListEvents, | |
| 148 | − | ], | |
| 149 | − | ), | |
| 150 | − | ( | |
| 151 | − | "Commit comments", | |
| 152 | − | "Comments on a commit, as a whole or on one line of a file it changed. Anyone who can read a repository reads them, and may comment unless the repository turned commit comments off.", | |
| 153 | − | &[ | |
| 154 | − | Op::ListRepoCommitComments, | |
| 155 | − | Op::ListCommitComments, | |
| 156 | − | Op::CreateCommitComment, | |
| 157 | − | Op::UpdateCommitComment, | |
| 158 | − | Op::DeleteCommitComment, | |
| 159 | 144 | ], | |
| 160 | 145 | ), | |
| 161 | 146 | ( | |
| ⋯ | |||
| 275 | 260 | Op::Security(SecurityOp::GetDependencyGraph), | |
| 276 | 261 | Op::Security(SecurityOp::GetSbom), | |
| 277 | 262 | Op::Security(SecurityOp::CompareDependencies), | |
| 278 | − | Op::Security(SecurityOp::RerunDependencyReview), | |
| 279 | 263 | ], | |
| 280 | 264 | ), | |
| 281 | 265 | ( | |
| ⋯ | |||
| 388 | 372 | ), | |
| 389 | 373 | ( | |
| 390 | 374 | "Pull requests", | |
| 391 | − | "A proposed change in its own fork or on a branch. Several can be made for one issue; the one merged resolves it. It merges by a merge commit, a squash, a rebase or a fast-forward, now or with auto-merge once everything it needs is met.", | |
| 375 | + | "A proposed change in its own fork or on a branch. Several can be made for one issue; the one merged resolves it.", | |
| 392 | 376 | &[ | |
| 393 | 377 | Op::ListPullRequests, | |
| 394 | 378 | Op::CreatePullRequest, | |
| ⋯ | |||
| 400 | 384 | Op::RequestReviewers, | |
| 401 | 385 | Op::RemoveRequestedReviewers, | |
| 402 | 386 | Op::ReviewPullRequest, | |
| 403 | − | Op::GetPullRequestMergeOptions, | |
| 404 | 387 | Op::MergePullRequest, | |
| 405 | − | Op::UpdatePullRequestBranch, | |
| 406 | − | Op::EnablePullRequestAutoMerge, | |
| 407 | − | Op::DisablePullRequestAutoMerge, | |
| 408 | − | Op::DeletePullRequestHeadBranch, | |
| 409 | − | Op::RestorePullRequestHeadBranch, | |
| 410 | 388 | Op::ClosePullRequest, | |
| 411 | 389 | Op::ReopenPullRequest, | |
| 412 | 390 | Op::GetMergeQueue, | |
| ⋯ | |||
| 541 | 519 | Op::Protection(ProtectionOp::SetForkPrApproval), | |
| 542 | 520 | Op::Protection(ProtectionOp::GetActionsAccess), | |
| 543 | 521 | Op::Protection(ProtectionOp::SetActionsAccess), | |
| 544 | − | Op::Protection(ProtectionOp::GetActionsPermissions), | |
| 545 | − | Op::Protection(ProtectionOp::SetActionsPermissions), | |
| 546 | 522 | Op::Protection(ProtectionOp::CreateRepositoryDispatch), | |
| 547 | 523 | Op::Protection(ProtectionOp::GetWorkspaceWorkflowPermissions), | |
| 548 | 524 | Op::Protection(ProtectionOp::SetWorkspaceWorkflowPermissions), | |
| ⋯ | |||
| 680 | 656 | Op::DeclineInvitation => "Decline a workspace invitation", | |
| 681 | 657 | Op::RevokeWorkspaceInvite => "Revoke a workspace's invite", | |
| 682 | 658 | Op::TransferRepo => "Transfer a repository", | |
| 683 | − | Op::ForkRepo => "Fork a repository", | |
| 684 | − | Op::ListForks => "List forks", | |
| 685 | − | Op::SyncFork => "Sync a fork", | |
| 686 | − | Op::DetachFork => "Detach a fork", | |
| 687 | 659 | Op::RenameRepo => "Rename a repository", | |
| 688 | 660 | Op::RenameBranch => "Rename a branch", | |
| 689 | 661 | Op::CreateBranch => "Create a branch", | |
| ⋯ | |||
| 743 | 715 | Op::ConvertPullRequestToDraft => "Convert a pull request to a draft", | |
| 744 | 716 | Op::GetPullRequestChanges => "Get a pull request's changes", | |
| 745 | 717 | Op::MergePullRequest => "Merge a pull request", | |
| 746 | − | Op::GetPullRequestMergeOptions => "Get a pull request's merge options", | |
| 747 | − | Op::UpdatePullRequestBranch => "Update a pull request's branch", | |
| 748 | − | Op::EnablePullRequestAutoMerge => "Enable auto-merge", | |
| 749 | − | Op::DisablePullRequestAutoMerge => "Disable auto-merge", | |
| 750 | − | Op::DeletePullRequestHeadBranch => "Delete a pull request's branch", | |
| 751 | − | Op::RestorePullRequestHeadBranch => "Restore a pull request's branch", | |
| 752 | − | Op::ListRepoCommitComments => "List a repository's commit comments", | |
| 753 | − | Op::ListCommitComments => "List a commit's comments", | |
| 754 | − | Op::CreateCommitComment => "Comment on a commit", | |
| 755 | − | Op::UpdateCommitComment => "Edit a commit comment", | |
| 756 | − | Op::DeleteCommitComment => "Delete a commit comment", | |
| 757 | 718 | Op::ListEvents => "List repository events", | |
| 758 | 719 | Op::ListIntegrations => "List integrations", | |
| 759 | 720 | Op::ConnectIntegration => "Connect an integration", | |
| ⋯ | |||
| 884 | 845 | /// free workspace's private storage has no room for it. | |
| 885 | 846 | fn may_need_payment(op: Op) -> Option<&'static str> { | |
| 886 | 847 | match op { | |
| 887 | − | Op::UpdateRepo | Op::SetRepoVisibility | Op::TransferRepo | Op::ForkRepo => Some( | |
| 848 | + | Op::UpdateRepo | Op::SetRepoVisibility | Op::TransferRepo => Some( | |
| 888 | 849 | "A free workspace's private storage has no room for this private repository.", | |
| 889 | 850 | ), | |
| 890 | 851 | _ => None, | |
| 13 | 13 | use g1t_contracts::identity::AgentScope; | |
| 14 | 14 | use g1t_contracts::events::Event; | |
| 15 | 15 | use g1t_contracts::identity::{CreateWorkspaceArgs, UpdateWorkspaceArgs, Workspace}; | |
| 16 | − | use g1t_contracts::repos::{ | |
| 17 | − | CreateArgs, DetachForkArgs, ForkRepoArgs, ForksArgs, GetArgs, ListArgs as ListReposArgs, Repo, RepoPath, SyncForkArgs, | |
| 18 | − | }; | |
| 16 | + | use g1t_contracts::repos::{CreateArgs, GetArgs, ListArgs as ListReposArgs, Repo, RepoPath}; | |
| 19 | 17 | use g1t_contracts::teams::{ | |
| 20 | 18 | CreateTeamArgs, DeleteTeamArgs, ListTeamsArgs, RemoveTeamMemberArgs, RemoveTeamRepoArgs, ReviewAlgorithm, | |
| 21 | 19 | ReviewAssignment, SetTeamCreationArgs, SetTeamMemberArgs, SetTeamRepoArgs, Team, TeamArgs, TeamCreation, TeamRole, | |
| ⋯ | |||
| 44 | 42 | use crate::rules::RulesOp; | |
| 45 | 43 | use crate::security::SecurityOp; | |
| 46 | 44 | use g1t_contracts::inbox::{Reason, Severity, WATCH_EVENTS, WatchLevel}; | |
| 47 | − | use g1t_contracts::repos::UpdateMethod; | |
| 48 | − | use g1t_contracts::rules::MergeMethod; | |
| 49 | 45 | use g1t_contracts::work::*; | |
| 50 | 46 | use g1t_contracts::{FailureCode, Outcome, Viewer}; | |
| 51 | 47 | use serde::Serialize; | |
| ⋯ | |||
| 146 | 142 | CreateRepo, | |
| 147 | 143 | UpdateRepo, | |
| 148 | 144 | TransferRepo, | |
| 149 | − | ForkRepo, | |
| 150 | − | ListForks, | |
| 151 | − | SyncFork, | |
| 152 | − | DetachFork, | |
| 153 | 145 | RenameRepo, | |
| 154 | 146 | RenameBranch, | |
| 155 | 147 | CreateBranch, | |
| ⋯ | |||
| 205 | 197 | ReopenPullRequest, | |
| 206 | 198 | GetPullRequestChanges, | |
| 207 | 199 | MergePullRequest, | |
| 208 | − | GetPullRequestMergeOptions, | |
| 209 | − | UpdatePullRequestBranch, | |
| 210 | − | EnablePullRequestAutoMerge, | |
| 211 | − | DisablePullRequestAutoMerge, | |
| 212 | − | DeletePullRequestHeadBranch, | |
| 213 | − | RestorePullRequestHeadBranch, | |
| 214 | − | ListRepoCommitComments, | |
| 215 | − | ListCommitComments, | |
| 216 | − | CreateCommitComment, | |
| 217 | − | UpdateCommitComment, | |
| 218 | − | DeleteCommitComment, | |
| 219 | 200 | ListEvents, | |
| 220 | 201 | ListIntegrations, | |
| 221 | 202 | ConnectIntegration, | |
| ⋯ | |||
| 499 | 480 | "type": "string", | |
| 500 | 481 | "description": "The comment's id, such as \"cmt_01J9Z8\": each comment's id in get_issue or get_pull_request.", | |
| 501 | 482 | }) | |
| 502 | − | } | |
| 503 | − | ||
| 504 | − | fn commit_sha_schema() -> Value { | |
| 505 | − | json!({ "type": "string", "description": "The commit's hash, as list_commits gives it." }) | |
| 506 | 483 | } | |
| 507 | 484 | ||
| 508 | − | fn commit_comment_id_schema() -> Value { | |
| 509 | − | json!({ | |
| 510 | − | "type": "string", | |
| 511 | − | "description": "The commit comment's id, as list_commit_comments and list_repo_commit_comments give it.", | |
| 512 | − | }) | |
| 513 | − | } | |
| 514 | − | ||
| 515 | 485 | fn workspace_schema() -> Value { | |
| 516 | 486 | json!({ "type": "string", "description": "The workspace's slug, e.g. \"flagon-io\"." }) | |
| 517 | 487 | } | |
| ⋯ | |||
| 755 | 725 | properties | |
| 756 | 726 | } | |
| 757 | 727 | ||
| 758 | − | /// How a pull request merges. | |
| 759 | − | fn merge_method_schema(description: &str) -> Value { | |
| 760 | − | json!({ | |
| 761 | − | "type": "string", | |
| 762 | − | "enum": MergeMethod::ALL.map(MergeMethod::as_str), | |
| 763 | − | "description": description, | |
| 764 | − | }) | |
| 765 | − | } | |
| 766 | − | ||
| 767 | − | /// A merge method given by name, if one was given: `Err` names the ones | |
| 768 | − | /// there are. | |
| 769 | − | fn merge_method(input: &Value, key: &str) -> std::result::Result<Option<MergeMethod>, String> { | |
| 770 | − | match input[key].as_str().map(str::trim).filter(|given| !given.is_empty()) { | |
| 771 | − | None => Ok(None), | |
| 772 | − | Some(given) => MergeMethod::ALL | |
| 773 | − | .into_iter() | |
| 774 | − | .find(|method| method.as_str().eq_ignore_ascii_case(given)) | |
| 775 | − | .map(Some) | |
| 776 | − | .ok_or_else(|| format!("{key} must be merge, squash, rebase or fast_forward, not {given}.")), | |
| 777 | − | } | |
| 778 | − | } | |
| 779 | − | ||
| 780 | − | /// What a merge or squash commit says by default. | |
| 781 | − | const COMMIT_MESSAGE_DEFAULTS: [(&str, CommitMessageDefault); 5] = [ | |
| 782 | − | ("default", CommitMessageDefault::Default), | |
| 783 | − | ("pull_title", CommitMessageDefault::PullTitle), | |
| 784 | − | ("pull_title_and_description", CommitMessageDefault::PullTitleAndDescription), | |
| 785 | − | ("pull_title_and_commits", CommitMessageDefault::PullTitleAndCommits), | |
| 786 | − | ("custom", CommitMessageDefault::Custom), | |
| 787 | − | ]; | |
| 788 | − | ||
| 789 | − | fn commit_message_default(input: &Value, key: &str) -> std::result::Result<Option<CommitMessageDefault>, String> { | |
| 790 | − | match input[key].as_str().map(str::trim).filter(|given| !given.is_empty()) { | |
| 791 | − | None => Ok(None), | |
| 792 | − | Some(given) => COMMIT_MESSAGE_DEFAULTS | |
| 793 | − | .iter() | |
| 794 | − | .find(|(name, _)| name.eq_ignore_ascii_case(given)) | |
| 795 | − | .map(|(_, value)| Some(*value)) | |
| 796 | − | .ok_or_else(|| { | |
| 797 | − | format!("{key} must be default, pull_title, pull_title_and_description, pull_title_and_commits or custom, not {given}.") | |
| 798 | − | }), | |
| 799 | − | } | |
| 800 | − | } | |
| 801 | − | ||
| 802 | 728 | fn alert_id_schema() -> Value { | |
| 803 | 729 | json!({ | |
| 804 | 730 | "type": "string", | |
| ⋯ | |||
| 807 | 733 | } | |
| 808 | 734 | ||
| 809 | 735 | impl Op { | |
| 810 | − | pub const ALL: [Op; 403] = [ | |
| 736 | + | pub const ALL: [Op; 385] = [ | |
| 811 | 737 | Op::Whoami, | |
| 812 | 738 | Op::GetWorkspace, | |
| 813 | 739 | Op::CreateWorkspace, | |
| ⋯ | |||
| 838 | 764 | Op::CreateRepo, | |
| 839 | 765 | Op::UpdateRepo, | |
| 840 | 766 | Op::TransferRepo, | |
| 841 | − | Op::ForkRepo, | |
| 842 | − | Op::ListForks, | |
| 843 | − | Op::SyncFork, | |
| 844 | − | Op::DetachFork, | |
| 845 | 767 | Op::RenameRepo, | |
| 846 | 768 | Op::RenameBranch, | |
| 847 | 769 | Op::CreateBranch, | |
| ⋯ | |||
| 897 | 819 | Op::ReopenPullRequest, | |
| 898 | 820 | Op::GetPullRequestChanges, | |
| 899 | 821 | Op::MergePullRequest, | |
| 900 | − | Op::GetPullRequestMergeOptions, | |
| 901 | − | Op::UpdatePullRequestBranch, | |
| 902 | − | Op::EnablePullRequestAutoMerge, | |
| 903 | − | Op::DisablePullRequestAutoMerge, | |
| 904 | − | Op::DeletePullRequestHeadBranch, | |
| 905 | − | Op::RestorePullRequestHeadBranch, | |
| 906 | − | Op::ListRepoCommitComments, | |
| 907 | − | Op::ListCommitComments, | |
| 908 | − | Op::CreateCommitComment, | |
| 909 | − | Op::UpdateCommitComment, | |
| 910 | − | Op::DeleteCommitComment, | |
| 911 | 822 | Op::ListEvents, | |
| 912 | 823 | Op::ListIntegrations, | |
| 913 | 824 | Op::ConnectIntegration, | |
| ⋯ | |||
| 1040 | 951 | Op::Security(SecurityOp::GetDependencyGraph), | |
| 1041 | 952 | Op::Security(SecurityOp::GetSbom), | |
| 1042 | 953 | Op::Security(SecurityOp::CompareDependencies), | |
| 1043 | − | Op::Security(SecurityOp::RerunDependencyReview), | |
| 1044 | 954 | Op::Security(SecurityOp::GetSettings), | |
| 1045 | 955 | Op::Security(SecurityOp::UpdateSettings), | |
| 1046 | 956 | Op::Security(SecurityOp::GetWorkspaceSettings), | |
| ⋯ | |||
| 1150 | 1060 | Op::Protection(ProtectionOp::SetForkPrApproval), | |
| 1151 | 1061 | Op::Protection(ProtectionOp::GetActionsAccess), | |
| 1152 | 1062 | Op::Protection(ProtectionOp::SetActionsAccess), | |
| 1153 | − | Op::Protection(ProtectionOp::GetActionsPermissions), | |
| 1154 | − | Op::Protection(ProtectionOp::SetActionsPermissions), | |
| 1155 | 1063 | Op::Protection(ProtectionOp::CreateRepositoryDispatch), | |
| 1156 | 1064 | Op::Protection(ProtectionOp::GetWorkspaceWorkflowPermissions), | |
| 1157 | 1065 | Op::Protection(ProtectionOp::SetWorkspaceWorkflowPermissions), | |
| ⋯ | |||
| 1250 | 1158 | Op::CreateRepo => "create_repo", | |
| 1251 | 1159 | Op::UpdateRepo => "update_repo", | |
| 1252 | 1160 | Op::TransferRepo => "transfer_repo", | |
| 1253 | − | Op::ForkRepo => "fork_repo", | |
| 1254 | − | Op::ListForks => "list_forks", | |
| 1255 | − | Op::SyncFork => "sync_fork", | |
| 1256 | − | Op::DetachFork => "detach_fork", | |
| 1257 | 1161 | Op::RenameRepo => "rename_repo", | |
| 1258 | 1162 | Op::RenameBranch => "rename_branch", | |
| 1259 | 1163 | Op::CreateBranch => "create_branch", | |
| ⋯ | |||
| 1309 | 1213 | Op::ConvertPullRequestToDraft => "convert_pull_request_to_draft", | |
| 1310 | 1214 | Op::GetPullRequestChanges => "get_pull_request_changes", | |
| 1311 | 1215 | Op::MergePullRequest => "merge_pull_request", | |
| 1312 | − | Op::GetPullRequestMergeOptions => "get_pull_request_merge_options", | |
| 1313 | − | Op::UpdatePullRequestBranch => "update_pull_request_branch", | |
| 1314 | − | Op::EnablePullRequestAutoMerge => "enable_pull_request_auto_merge", | |
| 1315 | − | Op::DisablePullRequestAutoMerge => "disable_pull_request_auto_merge", | |
| 1316 | − | Op::DeletePullRequestHeadBranch => "delete_pull_request_head_branch", | |
| 1317 | − | Op::RestorePullRequestHeadBranch => "restore_pull_request_head_branch", | |
| 1318 | − | Op::ListRepoCommitComments => "list_repo_commit_comments", | |
| 1319 | − | Op::ListCommitComments => "list_commit_comments", | |
| 1320 | − | Op::CreateCommitComment => "create_commit_comment", | |
| 1321 | − | Op::UpdateCommitComment => "update_commit_comment", | |
| 1322 | − | Op::DeleteCommitComment => "delete_commit_comment", | |
| 1323 | 1216 | Op::ListEvents => "list_events", | |
| 1324 | 1217 | Op::ListIntegrations => "list_integrations", | |
| 1325 | 1218 | Op::ConnectIntegration => "connect_integration", | |
| ⋯ | |||
| 1523 | 1416 | Op::ListRepos => "Repositories you can see, optionally filtered by a search query.", | |
| 1524 | 1417 | Op::GetRepo => "One repository's details.", | |
| 1525 | 1418 | Op::UpdateRepo => { | |
| 1526 | − | "Change a repository's description, website, topics and default branch, whether its default branch is protected, whether it is private, whether a private repository may be forked, and the most branches and tags one push may change (max_ref_updates). Only the fields given are changed. Its description, website and topics need the Maintain role or higher; protecting its default branch, making it public or private, allowing forking, max_ref_updates and changing its default branch need the Admin role (and making it public or private, the workspace's member privileges to allow it, unless you are an owner), and a free workspace takes a private repository only while its private storage has room. A protected branch refuses pushes and changes only by merging a pull request. A new default branch must already exist; open pull requests then merge into it. A fork cannot be made public or private: it is as visible as its parent until it is detached (detach_fork)." | |
| 1419 | + | "Change a repository's description, website, topics and default branch, whether its default branch is protected, and whether it is private. Only the fields given are changed. Its description, website and topics need the Maintain role or higher; protecting its default branch, making it public or private and changing its default branch need the Admin role (and making it public or private, the workspace's member privileges to allow it, unless you are an owner), and a free workspace takes a private repository only while its private storage has room. A protected branch refuses pushes and changes only by merging a pull request. A new default branch must already exist; open pull requests then merge into it." | |
| 1527 | 1420 | } | |
| 1528 | 1421 | Op::RenameRepo => { | |
| 1529 | 1422 | "Give a repository a new name in its workspace. Needs the Admin role. Everything stays with it: git data, issues, pull requests, workflow runs, deployments, secrets and webhooks. Its old address keeps working: web pages, git remotes and API calls redirect to the new one until a repository is made at the old address. The new name must be free in the workspace, including names held by recently deleted repositories." | |
| ⋯ | |||
| 1560 | 1453 | } | |
| 1561 | 1454 | Op::TransferRepo => { | |
| 1562 | 1455 | "Move a repository to another workspace, keeping its name. You must own both workspaces, and the destination must not already have a repository of that name; a free destination takes a private repository only if its private storage has room. Everything moves with it: git data, issues, pull requests, comments, labels, workflow runs, deployments, its project, and its own secrets, variables and webhooks. Its old address keeps working: web pages, git remotes and API calls redirect to the new one until a repository is made at the old address. Usage from now on is charged to the new workspace." | |
| 1563 | − | } | |
| 1564 | − | Op::ForkRepo => { | |
| 1565 | − | "Fork a repository: copy it into a workspace you can create repositories in, as a new repository that remembers the one it came from (its parent). Anyone who can read a public repository may fork it; a private one only when its admins allow forking (allow_forking on update_repo). A fork is exactly as visible as its parent: a public repository's fork is public, a private one's private. Only its code and description come with it: the default branch, or every branch and tag with default_branch_only false. Its issues, pull requests, settings, rulesets, secrets, variables, webhooks, environments and deployments stay behind; issues are off in the fork, and Actions is off until an admin of the fork turns it on. Its full size counts toward the destination workspace's storage, and a free workspace takes a private fork only while its private storage has room. workspace is the destination's slug: your personal workspace when left out. name is the parent's when left out. Returns the fork, with parent naming the repository it came from." | |
| 1566 | 1456 | } | |
| 1567 | − | Op::ListForks => { | |
| 1568 | − | "A repository's forks that you can see, newest first, each with parent naming the repository. limit is at most 100, 30 when left out. Forks of its forks are listed on them." | |
| 1569 | − | } | |
| 1570 | − | Op::SyncFork => { | |
| 1571 | − | "Bring a fork's branch up to date with its parent: branch (the fork's default branch when left out) takes in the parent's branch of the same name, or the parent's default branch for the fork's default branch. Needs the Write role on the fork and read access to its parent. A branch that is only behind moves forward (fast_forwarded); one with commits of its own gets a merge commit when the two sides' changes do not clash, edits to the same file merging line by line (merged); when both changed the same lines (or one deleted a file the other changed, or both changed a binary file) nothing is changed (conflicted, with the files in conflicts, at most 20): merge the parent's branch in a clone and push, or open a pull request. Returns status, branch, head (the branch's commit afterwards), behind and ahead (the commits each side had that the other lacked)." | |
| 1572 | − | } | |
| 1573 | − | Op::DetachFork => { | |
| 1574 | − | "Detach a fork from its parent: it becomes an ordinary repository with no parent, and can then be made public or private. Needs the Admin role on the fork. Its code, settings, and the pull requests it already opened into the parent stay as they are; it can no longer be synced or open new pull requests into the parent. It cannot be attached again." | |
| 1575 | − | } | |
| 1576 | 1457 | Op::GetRepoSettings => { | |
| 1577 | − | "How a repository handles pull requests, commits and issues: the merge methods it allows and the one offered first, what merge and squash commits say by default (merge_commit_message, squash_commit_message, and the templates for custom), whether pull requests may turn on auto-merge, whether their branches are deleted once merged, whether to suggest updating branches, whether web commits are signed off, whether commit comments are allowed, whether merged pull requests close the issues they name, and whether issues can be opened (issues_enabled); also whether they merge by themselves, and its default branch's protection as the rules of its rulesets stack there: the checks that must pass (required_checks), the approvals a merge needs, whether its code owners must approve (`require_code_owner_review`), whether required checks can be bypassed, whether a pull request must be up to date, and the merge queue. The same rules hold for every pull request, whoever opened it. list_repo_rulesets and get_branch_rules show every rule." | |
| 1458 | + | "How a repository handles pull requests: whether they merge by themselves, and its default branch's protection as the rules of its rulesets stack there: the checks that must pass (required_checks), the approvals a merge needs, whether its code owners must approve (`require_code_owner_review`), whether required checks can be bypassed, whether a pull request must be up to date, and the merge queue. The same rules hold for every pull request, whoever opened it. list_repo_rulesets and get_branch_rules show every rule." | |
| 1578 | 1459 | } | |
| 1579 | 1460 | Op::UpdateRepoSettings => { | |
| 1580 | − | "Change how a repository handles pull requests, commits and issues. Only the fields given are changed; required_checks replaces the whole list. At least one merge method must stay allowed, and default_merge_method must be one of them. A custom commit message (merge_commit_message or squash_commit_message custom) uses its template, whose {title}, {number}, {body}, {branch}, {head_repo}, {base}, {author}, {commits}, {issues} and {co_authors} are filled in; pull_title_and_commits is for squash commits only. The branch protection fields (required_checks, require_up_to_date, required_approvals, count_agent_approvals, allow_ignoring_checks, merge_queue, require_code_owner_review) are written to the repository's \"Default branch protection\" ruleset, made when it has none; rules only rulesets have stay as they are. A required check is named as list_check_names gives it: a workflow's name, such as CI, or another status's context, such as g1t / deploy. Needs the Maintain role or higher, and the Admin role to change a branch protection field." | |
| 1461 | + | "Change how a repository handles pull requests. Only the fields given are changed; required_checks replaces the whole list. The branch protection fields (required_checks, require_up_to_date, required_approvals, count_agent_approvals, allow_ignoring_checks, merge_queue, require_code_owner_review) are written to the repository's \"Default branch protection\" ruleset, made when it has none; rules only rulesets have stay as they are. A required check is named as list_check_names gives it: a workflow's name, such as CI, or another status's context, such as g1t / deploy. Needs the Maintain role or higher, and the Admin role to change a branch protection field." | |
| 1581 | 1462 | } | |
| 1582 | 1463 | Op::ListCheckNames => { | |
| 1583 | 1464 | "The check names reported on a repository's commits in the last 30 days, most recent first, with the events each was reported for: the names update_repo_settings takes in required_checks. A workflow's runs report a check named after the workflow; a check required on the default branch must be reported on a pull request's head (pull_request events) and, with the merge queue on, on its queued state (merge_group events)." | |
| ⋯ | |||
| 1694 | 1575 | "What a pull request changes: the files it touches and their line-by-line diff against the commit it started from. Use it to review a pull request or to compare several made for the same issue. A large one lists every file (up to 300; truncated says when there were more) but has the lines of only the first, about 20,000 lines read: the files after that come with omitted true and no lines or counts. Ask again with paths (up to 50 at a time) to have those files' lines." | |
| 1695 | 1576 | } | |
| 1696 | 1577 | Op::MergePullRequest => { | |
| 1697 | − | "Land a pull request on its base, the branch it merges into (the default branch unless it names another). merge_method says how: merge (a merge commit joins its branch to the base, its commits included), squash (one new commit holds everything it changed), rebase (each of its commits is made again on top of the base, in order) or fast_forward (the base moves to its head, exactly the commit that was checked; only when its branch contains the base's head). Left out, the repository's default_merge_method. A method the repository does not allow (allow_merge_commit, allow_squash_merge, allow_rebase_merge, allow_fast_forward on update_repo_settings), or that a rule for the base does not (allowed_merge_methods, and required linear history, which refuses merge), is refused. commit_title and commit_message are a merge or squash commit's message: its first line and the rest; left out, the repository's merge_commit_message or squash_commit_message decides. With sha, the merge is refused (409) if the pull request's head is no longer that commit. delete_branch deletes its branch once it has merged (left out, the repository's delete_branch_on_merge); restore_pull_request_head_branch brings it back. Merging needs the Write role or higher, and only once it is marked ready and it meets every rule that holds for its base (see rules and required_checks on get_pull_request: approvals, checks, deployments, merge windows and the rest, from the repository's and its workspace's rulesets); the refusal names the first rule not met. With ignore_checks, someone who may merge can bypass required checks where the rule allows it; with bypass_rules, someone a ruleset lists as a bypass actor merges past its rules, and it is recorded. Merging into the default branch closes the issues in its closes: the issue it was made for and those its title and description name after a closing keyword (Fixes #12), where the repository closes issues (auto_close_issues); the other pull requests still in progress for its issue close as superseded. Merging into another branch closes nothing. Where the repository has a merge queue, a pull request into the default branch joins the queue instead of landing at once. If its base has moved since the pull request was opened, it is brought up to date first and lands when that is done; a repository that requires pull requests into its default branch to be up to date refuses instead: update_pull_request_branch, then merge again. Check status in the result to see whether it has landed, and merge_method and merge_commit for how." | |
| 1698 | − | } | |
| 1699 | − | Op::GetPullRequestMergeOptions => { | |
| 1700 | − | "How a pull request may merge now, as the merge box offers it to you: the methods it may merge by (the repository's, as the rules for its base allow them) and the one offered first (default_method); each method's default commit title and message, and why one cannot be used now (unavailable); whether it is behind its base, can fast-forward as it is, should be offered an update (suggest_update) or must be up to date (require_up_to_date); whether it goes through the merge queue; whether you may turn on auto-merge; whether deleting its branch starts ticked and is possible; and whether commits made merging it are signed off." | |
| 1701 | − | } | |
| 1702 | − | Op::UpdatePullRequestBranch => { | |
| 1703 | − | "Bring a pull request's branch up to date with its base: update_method merge (the default) makes a merge commit on its branch that takes in the base's new commits; rebase makes each of its commits again on top of the base's head and moves its branch there, rewriting its history. Pushed as you, so you must be able to push to its branch: the Write role for a branch of the repository, its owner for a working copy, and push access to the fork for a branch of a fork. With expected_head_sha, refused (409) if its head is no longer that commit. Edits to the same file merge line by line; a rebase drops merge commits and commits the base already has, keeps authors, dates and messages, and moves its branch only if its head is still where it was. Returns outcome: updated (with commit, its head now, and previous), up_to_date, or needs_agent when both sides changed the same lines (with reason, detail and the paths): nothing was pushed, so merge or rebase in a clone and push." | |
| 1704 | − | } | |
| 1705 | − | Op::EnablePullRequestAutoMerge => { | |
| 1706 | − | "Turn on auto-merge for a pull request: it merges on its own, as you, once its required checks, reviews and rules allow, with merge_method (the repository's default when left out) and, for merge and squash, commit_title and commit_message. Needs the Write role, since it merges as you, and a repository that allows auto-merge (allow_auto_merge). A method the repository or a rule for its base does not allow is refused. A pull request that may merge already merges at once instead. Auto-merge is turned off when it merges or closes, when someone turns it off, and when someone other than whoever turned it on pushes to it. Publishes pull.auto_merge_enabled. Returns the pull request, with auto_merge saying how and who asked." | |
| 1707 | − | } | |
| 1708 | − | Op::DisablePullRequestAutoMerge => { | |
| 1709 | − | "Turn off auto-merge for a pull request: it waits for someone to merge it. Needs the Write role, or to be its author. Publishes pull.auto_merge_disabled. Returns the pull request, with auto_merge null." | |
| 1710 | − | } | |
| 1711 | − | Op::DeletePullRequestHeadBranch => { | |
| 1712 | − | "Delete a merged or closed pull request's branch: a branch of the repository, or of a fork you can push to. Needs the Write role (push access to the fork, for a fork's branch). Refused while the pull request is open, for the default branch, for a branch an open pull request still uses, and where rules protect it. head_branch_deleted is then true, and restore_pull_request_head_branch makes it again at its head. Publishes pull.head_branch_deleted. Returns the pull request." | |
| 1713 | − | } | |
| 1714 | − | Op::RestorePullRequestHeadBranch => { | |
| 1715 | − | "Make a pull request's deleted branch again, at the pull request's head commit (head_commit). Needs the Write role (push access to the fork, for a fork's branch). Refused when a branch of that name exists again. Publishes pull.head_branch_restored. Returns the pull request." | |
| 1716 | − | } | |
| 1717 | − | Op::ListRepoCommitComments => { | |
| 1718 | − | "A repository's commit comments, newest first, 30 a page (page from 1). Each names its commit; one on a line of a file has path and line. Anyone who can read the repository can read them." | |
| 1719 | − | } | |
| 1720 | − | Op::ListCommitComments => { | |
| 1721 | − | "A commit's comments, oldest first: on the whole commit, or on one line of a file it changed (path and line). sha is the commit's hash. Anyone who can read the repository can read them." | |
| 1722 | − | } | |
| 1723 | − | Op::CreateCommitComment => { | |
| 1724 | − | "Comment on a commit, as a whole or, with path and line, on one line of a file the commit changed (a line of the file as the commit left it). Anyone who can read the repository may, unless it has turned commit comments off (allow_commit_comments on update_repo_settings). The commit's author and anyone mentioned are notified. Publishes commit_comment.created." | |
| 1725 | − | } | |
| 1726 | − | Op::UpdateCommitComment => { | |
| 1727 | − | "Change a commit comment's text, named by comment_id. Its author only. Publishes commit_comment.edited." | |
| 1728 | − | } | |
| 1729 | − | Op::DeleteCommitComment => { | |
| 1730 | − | "Delete a commit comment, named by comment_id. Its author may, and so may anyone with the Maintain role or higher. This cannot be undone. Publishes commit_comment.deleted." | |
| 1578 | + | "Land a pull request on its base, the branch it merges into (the default branch unless it names another). Merging needs the Write role or higher, and only once it is marked ready and it meets every rule that holds for its base (see rules and required_checks on get_pull_request: approvals, checks, deployments, merge windows and the rest, from the repository's and its workspace's rulesets); the refusal names the first rule not met. With ignore_checks, someone who may merge can bypass required checks where the rule allows it; with bypass_rules, someone a ruleset lists as a bypass actor merges past its rules, and it is recorded. Merging into the default branch resolves the issue it was made for: the issue closes recording this pull request, and the other pull requests still in progress for that issue close as superseded; merging into another branch leaves the issue open. Where the repository has a merge queue, a pull request into the default branch joins the queue instead of landing at once. If its base has moved since the pull request was opened, it is brought up to date first and lands when that is done; a repository that requires pull requests into its default branch to be up to date refuses instead, so pull the base into its fork or branch, push, and merge again. Check status in the result to see whether it has landed." | |
| 1731 | 1579 | } | |
| 1732 | 1580 | Op::ListEvents => { | |
| 1733 | 1581 | "The timeline of a repository: pushes, issues, pull requests, comments, sessions, claims and integration results, newest first; page back with before. To follow it, give after (an event id): the events written after that one come oldest first, and the last one's id is the next call's after. With after and wait (seconds, at most 25), a call that finds nothing holds on until a matching event is written or the wait ends, then returns what it has, perhaps nothing. Narrow it with types, numbers (issues and pull requests, matching events about them and comments on them), since and limit (50 by default, at most 200)." | |
| ⋯ | |||
| 2259 | 2107 | }), | |
| 2260 | 2108 | &["repo", "to"], | |
| 2261 | 2109 | ), | |
| 2262 | − | Op::ForkRepo => object( | |
| 2263 | − | json!({ | |
| 2264 | − | "repo": repo_schema(), | |
| 2265 | − | "workspace": { | |
| 2266 | − | "type": "string", | |
| 2267 | − | "description": "The slug of the workspace to fork it into, e.g. \"flagon-io\". Your personal workspace when left out.", | |
| 2268 | − | }, | |
| 2269 | − | "name": { "type": "string", "description": "The fork's name; the repository's own when left out." }, | |
| 2270 | − | "description": { "type": "string", "description": "The fork's description; the repository's own when left out, none when empty." }, | |
| 2271 | − | "default_branch_only": { | |
| 2272 | − | "type": "boolean", | |
| 2273 | − | "description": "Copy only the default branch (the default). false copies every branch and tag.", | |
| 2274 | − | }, | |
| 2275 | − | }), | |
| 2276 | − | &["repo"], | |
| 2277 | − | ), | |
| 2278 | − | Op::ListForks => object( | |
| 2279 | − | json!({ | |
| 2280 | − | "repo": repo_schema(), | |
| 2281 | − | "limit": { "type": "integer", "minimum": 1, "maximum": 100, "description": "At most this many; 30 when left out." }, | |
| 2282 | − | }), | |
| 2283 | − | &["repo"], | |
| 2284 | − | ), | |
| 2285 | − | Op::SyncFork => object( | |
| 2286 | − | json!({ | |
| 2287 | − | "repo": repo_schema(), | |
| 2288 | − | "branch": { "type": "string", "description": "The fork's branch to sync; its default branch when left out." }, | |
| 2289 | − | }), | |
| 2290 | − | &["repo"], | |
| 2291 | − | ), | |
| 2292 | − | Op::DetachFork => repo_only(), | |
| 2293 | 2110 | Op::GetRepo | Op::ListLabels | Op::AddDefaultLabels => repo_only(), | |
| 2294 | 2111 | Op::CreateLabel => object( | |
| 2295 | 2112 | json!({ | |
| ⋯ | |||
| 2376 | 2193 | "default_branch": { | |
| 2377 | 2194 | "type": "string", | |
| 2378 | 2195 | "description": "Make this existing branch the default: the one clones check out and pull requests merge into.", | |
| 2379 | − | }, | |
| 2380 | − | "allow_forking": { | |
| 2381 | − | "type": "boolean", | |
| 2382 | − | "description": "Let people who can read this private repository fork it; their forks stay private. Public repositories can always be forked.", | |
| 2383 | 2196 | }, | |
| 2384 | − | "max_ref_updates": { | |
| 2385 | − | "type": "integer", | |
| 2386 | − | "minimum": 0, | |
| 2387 | − | "maximum": 1000, | |
| 2388 | − | "description": "The most branches and tags one push may change, 1 to 1,000; a push that would change more is declined whole. 0 for no limit.", | |
| 2389 | − | }, | |
| 2390 | 2197 | }), | |
| 2391 | 2198 | &["repo"], | |
| 2392 | 2199 | ), | |
| ⋯ | |||
| 2515 | 2322 | "require_code_owner_review": { | |
| 2516 | 2323 | "type": "boolean", | |
| 2517 | 2324 | "description": "Refuse to merge until the code owners of every file a pull request changes, as the CODEOWNERS file of the branch it merges into names them, have approved it, as many as each section asks. Only people's approvals count, and g1t's only where the file names @g1t.", | |
| 2518 | − | }, | |
| 2519 | − | "allow_merge_commit": { | |
| 2520 | − | "type": "boolean", | |
| 2521 | − | "description": "Let pull requests merge with a merge commit (merge). At least one method stays allowed.", | |
| 2522 | − | }, | |
| 2523 | − | "allow_squash_merge": { | |
| 2524 | − | "type": "boolean", | |
| 2525 | − | "description": "Let pull requests merge as one squashed commit (squash).", | |
| 2526 | − | }, | |
| 2527 | − | "allow_rebase_merge": { | |
| 2528 | − | "type": "boolean", | |
| 2529 | − | "description": "Let pull requests merge by making each of their commits again on the base (rebase).", | |
| 2530 | − | }, | |
| 2531 | − | "allow_fast_forward": { | |
| 2532 | − | "type": "boolean", | |
| 2533 | − | "description": "Let pull requests merge by moving the base to their head, with no new commit (fast_forward). Off unless turned on.", | |
| 2534 | − | }, | |
| 2535 | − | "default_merge_method": merge_method_schema("The method offered first, and used when a merge names none. Must be allowed."), | |
| 2536 | − | "merge_commit_message": { | |
| 2537 | − | "type": "string", | |
| 2538 | − | "enum": ["default", "pull_title", "pull_title_and_description", "custom"], | |
| 2539 | − | "description": "What a merge commit says unless its merger writes it: default (\"Merge pull request #12 from owner/branch\" and its title), pull_title (its title, with its number), pull_title_and_description (and its description below), or custom (merge_commit_template).", | |
| 2540 | − | }, | |
| 2541 | − | "squash_commit_message": { | |
| 2542 | − | "type": "string", | |
| 2543 | − | "enum": ["default", "pull_title", "pull_title_and_description", "pull_title_and_commits", "custom"], | |
| 2544 | − | "description": "What a squash commit says unless its merger writes it: default (its title for one commit, else its title and the commits' messages), pull_title, pull_title_and_description, pull_title_and_commits (its title, and each commit's message below), or custom (squash_commit_template).", | |
| 2545 | − | }, | |
| 2546 | − | "merge_commit_template": { | |
| 2547 | − | "type": "string", | |
| 2548 | − | "description": "With merge_commit_message custom: the message, its first line the title. {title}, {number}, {body}, {branch}, {head_repo}, {base}, {author}, {commits}, {issues} and {co_authors} are filled in. An empty string clears it.", | |
| 2549 | − | }, | |
| 2550 | − | "squash_commit_template": { | |
| 2551 | − | "type": "string", | |
| 2552 | − | "description": "With squash_commit_message custom: the message, with the same placeholders as merge_commit_template. An empty string clears it.", | |
| 2553 | − | }, | |
| 2554 | − | "suggest_updating_branches": { | |
| 2555 | − | "type": "boolean", | |
| 2556 | − | "description": "Offer to update a pull request's branch whenever its base has new commits, not only when it must be up to date to merge.", | |
| 2557 | − | }, | |
| 2558 | − | "allow_auto_merge": { | |
| 2559 | − | "type": "boolean", | |
| 2560 | − | "description": "Let people turn on auto-merge for a pull request, so it merges on its own once everything it needs is met.", | |
| 2561 | 2325 | }, | |
| 2562 | − | "delete_branch_on_merge": { | |
| 2563 | − | "type": "boolean", | |
| 2564 | − | "description": "Delete a pull request's branch once it merges. It can be restored from the pull request.", | |
| 2565 | − | }, | |
| 2566 | − | "require_web_commit_sign_off": { | |
| 2567 | − | "type": "boolean", | |
| 2568 | − | "description": "Commits made on g1t (web edits, merge and squash commits) carry a Signed-off-by: trailer for whoever made them.", | |
| 2569 | − | }, | |
| 2570 | − | "allow_commit_comments": { | |
| 2571 | − | "type": "boolean", | |
| 2572 | − | "description": "Let anyone who can read the repository comment on its commits. Existing comments stay readable either way.", | |
| 2573 | − | }, | |
| 2574 | − | "auto_close_issues": { | |
| 2575 | − | "type": "boolean", | |
| 2576 | − | "description": "Close the issues a pull request names (its issue, and Fixes #12 in its title or description) when it merges into the default branch.", | |
| 2577 | − | }, | |
| 2578 | − | "has_issues": { | |
| 2579 | − | "type": "boolean", | |
| 2580 | − | "description": "Whether issues can be opened in it. null goes back to the default: on for a repository, off for a fork. Existing issues stay readable either way.", | |
| 2581 | − | }, | |
| 2582 | 2326 | }), | |
| 2583 | 2327 | &["repo"], | |
| 2584 | 2328 | ), | |
| ⋯ | |||
| 2771 | 2515 | }, | |
| 2772 | 2516 | "branch": { | |
| 2773 | 2517 | "type": "string", | |
| 2774 | − | "description": "A branch already pushed to the repository (or to head_repo) that holds the change. Leave out to get a fork.", | |
| 2775 | − | }, | |
| 2776 | − | "head_repo": { | |
| 2777 | − | "type": "string", | |
| 2778 | − | "description": "A fork of the repository, \"owner/name\", whose branch holds the change: to propose a change from your fork. Needs branch.", | |
| 2518 | + | "description": "A branch already pushed to the repository that holds the change. Leave out to get a fork.", | |
| 2779 | 2519 | }, | |
| 2780 | 2520 | "body": { | |
| 2781 | 2521 | "type": "string", | |
| ⋯ | |||
| 2861 | 2601 | "bypass_rules": { | |
| 2862 | 2602 | "type": "boolean", | |
| 2863 | 2603 | "description": "Merge although rules are not met, where a ruleset lists you as one who may bypass it. Recorded as a bypass in its evaluations.", | |
| 2864 | − | }, | |
| 2865 | − | "merge_method": merge_method_schema("How to merge: merge, squash, rebase or fast_forward. The repository's default_merge_method when left out."), | |
| 2866 | − | "commit_title": { | |
| 2867 | − | "type": "string", | |
| 2868 | − | "description": "For merge and squash: the commit message's first line. The repository's default when left out.", | |
| 2869 | − | }, | |
| 2870 | − | "commit_message": { | |
| 2871 | − | "type": "string", | |
| 2872 | − | "description": "For merge and squash: the rest of the commit message. The repository's default when left out.", | |
| 2873 | − | }, | |
| 2874 | − | "sha": { | |
| 2875 | − | "type": "string", | |
| 2876 | − | "description": "The head commit you reviewed: refused (409) if the pull request's head has moved since.", | |
| 2877 | − | }, | |
| 2878 | − | "delete_branch": { | |
| 2879 | − | "type": "boolean", | |
| 2880 | − | "description": "Delete its branch once merged. The repository's delete_branch_on_merge when left out.", | |
| 2881 | − | }, | |
| 2882 | − | })), | |
| 2883 | − | &["repo", "number"], | |
| 2884 | − | ), | |
| 2885 | − | Op::UpdatePullRequestBranch => object( | |
| 2886 | − | numbered(json!({ | |
| 2887 | − | "expected_head_sha": { | |
| 2888 | − | "type": "string", | |
| 2889 | − | "description": "The head commit you saw: refused (409) if the pull request's head has moved since.", | |
| 2890 | − | }, | |
| 2891 | − | "update_method": { | |
| 2892 | − | "type": "string", | |
| 2893 | − | "enum": ["merge", "rebase"], | |
| 2894 | − | "description": "merge (the default): a merge commit on its branch takes in the base's new commits. rebase: its commits are made again on the base's head, rewriting its branch.", | |
| 2895 | − | }, | |
| 2896 | − | })), | |
| 2897 | − | &["repo", "number"], | |
| 2898 | − | ), | |
| 2899 | − | Op::EnablePullRequestAutoMerge => object( | |
| 2900 | − | numbered(json!({ | |
| 2901 | − | "merge_method": merge_method_schema("How it will merge: merge, squash, rebase or fast_forward. The repository's default_merge_method when left out."), | |
| 2902 | − | "commit_title": { | |
| 2903 | − | "type": "string", | |
| 2904 | − | "description": "For merge and squash: the commit message's first line. The repository's default when left out.", | |
| 2905 | − | }, | |
| 2906 | − | "commit_message": { | |
| 2907 | − | "type": "string", | |
| 2908 | − | "description": "For merge and squash: the rest of the commit message. The repository's default when left out.", | |
| 2909 | 2604 | }, | |
| 2910 | 2605 | })), | |
| 2911 | 2606 | &["repo", "number"], | |
| 2912 | 2607 | ), | |
| 2913 | − | Op::GetPullRequestMergeOptions | |
| 2914 | − | | Op::DisablePullRequestAutoMerge | |
| 2915 | − | | Op::DeletePullRequestHeadBranch | |
| 2916 | − | | Op::RestorePullRequestHeadBranch => { | |
| 2917 | − | just_numbered() | |
| 2918 | − | } | |
| 2919 | − | Op::ListRepoCommitComments => object( | |
| 2920 | − | json!({ | |
| 2921 | − | "repo": repo_schema(), | |
| 2922 | − | "page": { "type": "integer", "minimum": 1, "description": "From 1; 30 comments a page." }, | |
| 2923 | − | }), | |
| 2924 | − | &["repo"], | |
| 2925 | − | ), | |
| 2926 | − | Op::ListCommitComments => object( | |
| 2927 | − | json!({ "repo": repo_schema(), "sha": commit_sha_schema() }), | |
| 2928 | − | &["repo", "sha"], | |
| 2929 | − | ), | |
| 2930 | − | Op::CreateCommitComment => object( | |
| 2931 | − | json!({ | |
| 2932 | − | "repo": repo_schema(), | |
| 2933 | − | "sha": commit_sha_schema(), | |
| 2934 | − | "body": { "type": "string", "description": "Markdown." }, | |
| 2935 | − | "path": { | |
| 2936 | − | "type": "string", | |
| 2937 | − | "description": "A file the commit changed, from the repository's root, to comment on one of its lines.", | |
| 2938 | − | }, | |
| 2939 | − | "line": { | |
| 2940 | − | "type": "integer", | |
| 2941 | − | "minimum": 1, | |
| 2942 | − | "description": "With path: the line, as the commit left the file, counted from 1.", | |
| 2943 | − | }, | |
| 2944 | − | }), | |
| 2945 | − | &["repo", "sha", "body"], | |
| 2946 | − | ), | |
| 2947 | − | Op::UpdateCommitComment => object( | |
| 2948 | − | json!({ | |
| 2949 | − | "repo": repo_schema(), | |
| 2950 | − | "comment_id": commit_comment_id_schema(), | |
| 2951 | − | "body": { "type": "string", "description": "The new text, in Markdown." }, | |
| 2952 | − | }), | |
| 2953 | − | &["repo", "comment_id", "body"], | |
| 2954 | − | ), | |
| 2955 | − | Op::DeleteCommitComment => object( | |
| 2956 | − | json!({ "repo": repo_schema(), "comment_id": commit_comment_id_schema() }), | |
| 2957 | − | &["repo", "comment_id"], | |
| 2958 | − | ), | |
| 2959 | 2608 | Op::ListEvents => object( | |
| 2960 | 2609 | json!({ | |
| 2961 | 2610 | "repo": repo_schema(), | |
| ⋯ | |||
| 3731 | 3380 | Op::ListRepos | |
| 3732 | 3381 | | Op::Search | |
| 3733 | 3382 | | Op::GetRepo | |
| 3734 | − | | Op::ListForks | |
| 3735 | 3383 | | Op::ListIssues | |
| 3736 | 3384 | | Op::GetIssue | |
| 3737 | 3385 | | Op::ListLabels | |
| ⋯ | |||
| 3744 | 3392 | | Op::ListDecisions | |
| 3745 | 3393 | | Op::Why | |
| 3746 | 3394 | | Op::GetPullRequestChanges | |
| 3747 | − | | Op::GetPullRequestMergeOptions | |
| 3748 | − | | Op::ListRepoCommitComments | |
| 3749 | − | | Op::ListCommitComments | |
| 3750 | 3395 | | Op::ListEvents | |
| 3751 | 3396 | | Op::GetRepoSettings | |
| 3752 | 3397 | | Op::ListCheckNames | |
| ⋯ | |||
| 3767 | 3412 | | ProtectionOp::GetWorkflowPermissions | |
| 3768 | 3413 | | ProtectionOp::GetForkPrApproval | |
| 3769 | 3414 | | ProtectionOp::GetActionsAccess | |
| 3770 | − | | ProtectionOp::GetActionsPermissions | |
| 3771 | 3415 | ) | |
| 3772 | 3416 | ) | |
| 3773 | 3417 | } | |
| ⋯ | |||
| 4062 | 3706 | keep_issue_open: input["keep_issue_open"].as_bool() == Some(true), | |
| 4063 | 3707 | ignore_checks: input["ignore_checks"].as_bool() == Some(true), | |
| 4064 | 3708 | bypass_rules: input["bypass_rules"].as_bool() == Some(true), | |
| 4065 | − | merge_method: None, | |
| 4066 | − | commit_title: None, | |
| 4067 | − | commit_message: None, | |
| 4068 | − | expected_head: None, | |
| 4069 | − | delete_branch: None, | |
| 4070 | − | update_method: None, | |
| 4071 | 3709 | }; | |
| 4072 | 3710 | let Services { | |
| 4073 | 3711 | identity, | |
| ⋯ | |||
| 4457 | 4095 | "to": text(input, "to").to_lowercase(), | |
| 4458 | 4096 | "surface": services.audit.surface, | |
| 4459 | 4097 | }), | |
| 4460 | − | ) | |
| 4461 | − | .await | |
| 4462 | − | } | |
| 4463 | − | Op::ForkRepo => { | |
| 4464 | − | let owner = actor(); | |
| 4465 | − | // Your personal workspace (your username's), or the only | |
| 4466 | − | // one you belong to, when none is named. | |
| 4467 | − | let namespace = optional_text(input, "workspace").map(|slug| slug.to_lowercase()).unwrap_or_else(|| { | |
| 4468 | − | if owner.workspaces.iter().any(|w| w.slug == owner.username) { | |
| 4469 | − | owner.username.clone() | |
| 4470 | − | } else { | |
| 4471 | − | match owner.workspaces.as_slice() { | |
| 4472 | − | [only] => only.slug.clone(), | |
| 4473 | − | _ => String::new(), | |
| 4474 | − | } | |
| 4475 | − | } | |
| 4476 | − | }); | |
| 4477 | − | pass( | |
| 4478 | − | repos, | |
| 4479 | − | "fork", | |
| 4480 | − | &ForkRepoArgs { | |
| 4481 | − | actor: owner, | |
| 4482 | − | path: repo, | |
| 4483 | − | namespace, | |
| 4484 | − | name: optional_text(input, "name"), | |
| 4485 | − | description: input["description"].as_str().map(str::to_owned), | |
| 4486 | − | default_branch_only: input["default_branch_only"].as_bool() != Some(false), | |
| 4487 | − | surface: Some(services.audit.surface), | |
| 4488 | − | }, | |
| 4489 | 4098 | ) | |
| 4490 | 4099 | .await | |
| 4491 | 4100 | } | |
| 4492 | − | Op::ListForks => { | |
| 4493 | − | pass( | |
| 4494 | − | repos, | |
| 4495 | − | "forks", | |
| 4496 | − | &ForksArgs { | |
| 4497 | − | viewer: viewer.clone(), | |
| 4498 | − | path: repo, | |
| 4499 | − | limit: integer(input, "limit"), | |
| 4500 | − | }, | |
| 4501 | − | ) | |
| 4502 | − | .await | |
| 4503 | − | } | |
| 4504 | − | Op::SyncFork => { | |
| 4505 | − | pass( | |
| 4506 | − | repos, | |
| 4507 | − | "sync_fork", | |
| 4508 | − | &SyncForkArgs { | |
| 4509 | − | actor: actor(), | |
| 4510 | − | path: repo, | |
| 4511 | − | branch: optional_text(input, "branch"), | |
| 4512 | − | surface: Some(services.audit.surface), | |
| 4513 | − | }, | |
| 4514 | − | ) | |
| 4515 | − | .await | |
| 4516 | − | } | |
| 4517 | − | Op::DetachFork => { | |
| 4518 | − | pass( | |
| 4519 | − | repos, | |
| 4520 | − | "detach_fork", | |
| 4521 | − | &DetachForkArgs { | |
| 4522 | − | actor: actor(), | |
| 4523 | − | path: repo, | |
| 4524 | − | surface: Some(services.audit.surface), | |
| 4525 | − | }, | |
| 4526 | − | ) | |
| 4527 | − | .await | |
| 4528 | − | } | |
| 4529 | 4101 | Op::ListRepos => { | |
| 4530 | 4102 | let found: Vec<Repo> = g1t_kit::call( | |
| 4531 | 4103 | repos, | |
| ⋯ | |||
| 4552 | 4124 | .await | |
| 4553 | 4125 | } | |
| 4554 | 4126 | Op::UpdateRepo => { | |
| 4555 | − | let max_ref_updates = integer(input, "max_ref_updates"); | |
| 4556 | − | if input.get("max_ref_updates").is_some_and(|given| !given.is_null()) && max_ref_updates.is_none() { | |
| 4557 | − | return failed(FailureCode::Invalid, "max_ref_updates must be a whole number, 0 for no limit."); | |
| 4558 | − | } | |
| 4559 | 4127 | let updated = pass( | |
| 4560 | 4128 | repos, | |
| 4561 | 4129 | "update", | |
| ⋯ | |||
| 4567 | 4135 | "protected": input["protected"].as_bool(), | |
| 4568 | 4136 | "topics": strings(input, "topics"), | |
| 4569 | 4137 | "website": input["website"].as_str(), | |
| 4570 | − | "allowForking": input["allow_forking"].as_bool(), | |
| 4571 | − | "maxRefUpdates": max_ref_updates, | |
| 4572 | 4138 | "surface": services.audit.surface, | |
| 4573 | 4139 | }), | |
| 4574 | 4140 | ) | |
| ⋯ | |||
| 4762 | 4328 | Outcome::Fail(failure) => return Ok(Outcome::Fail(failure)), | |
| 4763 | 4329 | }; | |
| 4764 | 4330 | let flag = |key: &str, now: bool| input[key].as_bool().unwrap_or(now); | |
| 4765 | − | let default_merge_method = match merge_method(input, "default_merge_method") { | |
| 4766 | − | Ok(method) => method.unwrap_or(current.default_merge_method), | |
| 4767 | − | Err(message) => return failed(FailureCode::Invalid, &message), | |
| 4768 | − | }; | |
| 4769 | − | let merge_commit_message = match commit_message_default(input, "merge_commit_message") { | |
| 4770 | − | Ok(Some(CommitMessageDefault::PullTitleAndCommits)) => { | |
| 4771 | − | return failed(FailureCode::Invalid, "pull_title_and_commits is for squash commits: use it in squash_commit_message."); | |
| 4772 | − | } | |
| 4773 | − | Ok(given) => given.unwrap_or(current.merge_commit_message), | |
| 4774 | − | Err(message) => return failed(FailureCode::Invalid, &message), | |
| 4775 | − | }; | |
| 4776 | − | let squash_commit_message = match commit_message_default(input, "squash_commit_message") { | |
| 4777 | − | Ok(given) => given.unwrap_or(current.squash_commit_message), | |
| 4778 | − | Err(message) => return failed(FailureCode::Invalid, &message), | |
| 4779 | − | }; | |
| 4780 | − | // A template given empty clears it; one left out stays. | |
| 4781 | − | let template = |key: &str, now: &Option<String>| match input.get(key) { | |
| 4782 | − | None => now.clone(), | |
| 4783 | − | Some(given) => given.as_str().map(str::to_owned).filter(|text| !text.trim().is_empty()), | |
| 4784 | − | }; | |
| 4785 | − | let has_issues = match input.get("has_issues") { | |
| 4786 | − | None => current.has_issues, | |
| 4787 | − | Some(Value::Null) => None, | |
| 4788 | − | Some(given) => match given.as_bool() { | |
| 4789 | − | Some(on) => Some(on), | |
| 4790 | − | None => return failed(FailureCode::Invalid, "has_issues must be true, false or null."), | |
| 4791 | − | }, | |
| 4792 | − | }; | |
| 4793 | 4331 | let settings = RepoSettings { | |
| 4794 | − | allow_merge_commit: flag("allow_merge_commit", current.allow_merge_commit), | |
| 4795 | − | allow_squash_merge: flag("allow_squash_merge", current.allow_squash_merge), | |
| 4796 | − | allow_rebase_merge: flag("allow_rebase_merge", current.allow_rebase_merge), | |
| 4797 | − | allow_fast_forward: flag("allow_fast_forward", current.allow_fast_forward), | |
| 4798 | − | default_merge_method, | |
| 4799 | − | merge_commit_message, | |
| 4800 | − | squash_commit_message, | |
| 4801 | − | merge_commit_template: template("merge_commit_template", ¤t.merge_commit_template), | |
| 4802 | − | squash_commit_template: template("squash_commit_template", ¤t.squash_commit_template), | |
| 4803 | − | suggest_updating_branches: flag("suggest_updating_branches", current.suggest_updating_branches), | |
| 4804 | − | allow_auto_merge: flag("allow_auto_merge", current.allow_auto_merge), | |
| 4805 | − | delete_branch_on_merge: flag("delete_branch_on_merge", current.delete_branch_on_merge), | |
| 4806 | − | require_web_commit_sign_off: flag("require_web_commit_sign_off", current.require_web_commit_sign_off), | |
| 4807 | − | allow_commit_comments: flag("allow_commit_comments", current.allow_commit_comments), | |
| 4808 | − | auto_close_issues: flag("auto_close_issues", current.auto_close_issues), | |
| 4809 | − | has_issues, | |
| 4810 | 4332 | auto_merge: flag("auto_merge", current.auto_merge), | |
| 4811 | 4333 | required_checks: strings(input, "required_checks").unwrap_or(current.required_checks.clone()), | |
| 4812 | 4334 | require_up_to_date: flag("require_up_to_date", current.require_up_to_date), | |
| ⋯ | |||
| 5121 | 4643 | Op::GetPullRequest => pass(work, "get_pull", &view()).await, | |
| 5122 | 4644 | Op::CreatePullRequest => { | |
| 5123 | 4645 | let user = actor(); | |
| 5124 | − | // A fork named but not as `owner/name` is refused, never | |
| 5125 | − | // read as the repository's own branch of that name. | |
| 5126 | − | let head_repo = match optional_text(input, "head_repo") { | |
| 5127 | − | Some(_) => match repo_path(&json!({ "repo": input["head_repo"] })) { | |
| 5128 | − | Some(path) => Some(path), | |
| 5129 | − | None => return failed(FailureCode::Invalid, "Give head_repo as owner/name."), | |
| 5130 | − | }, | |
| 5131 | − | None => None, | |
| 5132 | − | }; | |
| 5133 | 4646 | let opened: Outcome<Pull> = call( | |
| 5134 | 4647 | work, | |
| 5135 | 4648 | "open_pull", | |
| ⋯ | |||
| 5140 | 4653 | title: text(input, "title"), | |
| 5141 | 4654 | body: text(input, "body"), | |
| 5142 | 4655 | branch: optional_text(input, "branch"), | |
| 5143 | − | head_repo, | |
| 5144 | 4656 | // Unnamed, the change is its author's, unless an agent's token opened it. | |
| 5145 | 4657 | agent: optional_text(input, "agent") | |
| 5146 | 4658 | .unwrap_or_else(|| if g1t_contracts::rules::is_agent(&user) { "agent".into() } else { user.username.clone() }), | |
| ⋯ | |||
| 5155 | 4667 | Outcome::Fail(failure) => return Ok(Outcome::Fail(failure)), | |
| 5156 | 4668 | }; | |
| 5157 | 4669 | // Where to push. A pull request from a branch has no fork: | |
| 5158 | − | // push to that branch of the repository, or of the fork | |
| 5159 | − | // it was opened from. | |
| 5160 | − | let source = pull.fork.as_ref().or(pull.head_repo.as_ref()).unwrap_or(&repo); | |
| 4670 | + | // push to that branch of the repository. | |
| 4671 | + | let source = pull.fork.as_ref().unwrap_or(&repo); | |
| 5161 | 4672 | let remote = services.addresses.git_remote(&source.namespace, &source.name); | |
| 5162 | 4673 | ok(&json!({ | |
| 5163 | 4674 | "pull": pull, | |
| ⋯ | |||
| 5239 | 4750 | let method = if self == Op::EditComment { "edit_comment" } else { "delete_comment" }; | |
| 5240 | 4751 | pass(work, method, &asked).await | |
| 5241 | 4752 | } | |
| 5242 | − | Op::MergePullRequest => { | |
| 5243 | − | let method = match merge_method(input, "merge_method") { | |
| 5244 | − | Ok(method) => method, | |
| 5245 | − | Err(message) => return failed(FailureCode::Invalid, &message), | |
| 5246 | − | }; | |
| 5247 | − | let asked = PullActionArgs { | |
| 5248 | − | merge_method: method, | |
| 5249 | − | commit_title: optional_text(input, "commit_title"), | |
| 5250 | − | commit_message: input["commit_message"].as_str().map(str::to_owned), | |
| 5251 | − | expected_head: optional_text(input, "sha"), | |
| 5252 | − | delete_branch: input["delete_branch"].as_bool(), | |
| 5253 | − | ..pull_action() | |
| 5254 | − | }; | |
| 5255 | − | pass(work, "merge_pull", &asked).await | |
| 5256 | − | } | |
| 5257 | − | Op::GetPullRequestMergeOptions => pass(work, "merge_choices", &view()).await, | |
| 5258 | − | Op::UpdatePullRequestBranch => { | |
| 5259 | − | let update_method = match input["update_method"].as_str().map(str::trim).filter(|given| !given.is_empty()) { | |
| 5260 | − | None => None, | |
| 5261 | − | Some(given) if given.eq_ignore_ascii_case("merge") => Some(UpdateMethod::Merge), | |
| 5262 | − | Some(given) if given.eq_ignore_ascii_case("rebase") => Some(UpdateMethod::Rebase), | |
| 5263 | − | Some(given) => return failed(FailureCode::Invalid, &format!("update_method must be merge or rebase, not {given}.")), | |
| 5264 | − | }; | |
| 5265 | − | let asked = PullActionArgs { | |
| 5266 | − | expected_head: optional_text(input, "expected_head_sha"), | |
| 5267 | − | update_method, | |
| 5268 | − | ..pull_action() | |
| 5269 | − | }; | |
| 5270 | − | pass(work, "catch_up_pull", &asked).await | |
| 5271 | − | } | |
| 5272 | − | Op::EnablePullRequestAutoMerge | Op::DisablePullRequestAutoMerge => { | |
| 5273 | − | let enabled = self == Op::EnablePullRequestAutoMerge; | |
| 5274 | − | let method = match merge_method(input, "merge_method") { | |
| 5275 | − | Ok(method) => method.filter(|_| enabled), | |
| 5276 | − | Err(message) if enabled => return failed(FailureCode::Invalid, &message), | |
| 5277 | − | Err(_) => None, | |
| 5278 | − | }; | |
| 5279 | − | pass( | |
| 5280 | − | work, | |
| 5281 | − | "set_auto_merge", | |
| 5282 | − | &SetAutoMergeArgs { | |
| 5283 | − | actor: actor(), | |
| 5284 | − | repo, | |
| 5285 | − | number, | |
| 5286 | − | enabled, | |
| 5287 | − | merge_method: method, | |
| 5288 | − | commit_title: optional_text(input, "commit_title").filter(|_| enabled), | |
| 5289 | − | commit_message: input["commit_message"].as_str().map(str::to_owned).filter(|_| enabled), | |
| 5290 | − | }, | |
| 5291 | − | ) | |
| 5292 | − | .await | |
| 5293 | − | } | |
| 5294 | − | Op::DeletePullRequestHeadBranch => pass(work, "delete_head_branch", &pull_action()).await, | |
| 5295 | − | Op::RestorePullRequestHeadBranch => pass(work, "restore_head_branch", &pull_action()).await, | |
| 5296 | − | Op::ListRepoCommitComments | Op::ListCommitComments => { | |
| 5297 | − | let commit = if self == Op::ListCommitComments { | |
| 5298 | − | match optional_text(input, "sha") { | |
| 5299 | − | Some(sha) => Some(sha), | |
| 5300 | − | None => return failed(FailureCode::Invalid, "Give sha: the commit's hash."), | |
| 5301 | − | } | |
| 5302 | − | } else { | |
| 5303 | − | None | |
| 5304 | − | }; | |
| 5305 | − | pass( | |
| 5306 | − | work, | |
| 5307 | − | "commit_comments", | |
| 5308 | − | &CommitCommentsArgs { | |
| 5309 | − | viewer: viewer.clone(), | |
| 5310 | − | repo, | |
| 5311 | − | commit, | |
| 5312 | − | page: integer(input, "page").filter(|page| *page > 0), | |
| 5313 | − | }, | |
| 5314 | − | ) | |
| 5315 | − | .await | |
| 5316 | − | } | |
| 5317 | − | Op::CreateCommitComment => { | |
| 5318 | − | let body = text(input, "body"); | |
| 5319 | − | if body.trim().is_empty() { | |
| 5320 | − | return failed(FailureCode::Invalid, "Give body: the comment, in Markdown."); | |
| 5321 | − | } | |
| 5322 | − | let Some(commit) = optional_text(input, "sha") else { | |
| 5323 | − | return failed(FailureCode::Invalid, "Give sha: the commit's hash."); | |
| 5324 | − | }; | |
| 5325 | − | let path = optional_text(input, "path"); | |
| 5326 | − | let line = integer(input, "line").filter(|line| *line > 0); | |
| 5327 | − | if input.get("line").is_some_and(|given| !given.is_null()) && line.is_none() { | |
| 5328 | − | return failed(FailureCode::Invalid, "line is counted from 1."); | |
| 5329 | − | } | |
| 5330 | − | if line.is_some() && path.is_none() { | |
| 5331 | − | return failed(FailureCode::Invalid, "Give path with line: the file the line is in."); | |
| 5332 | − | } | |
| 5333 | − | pass( | |
| 5334 | − | work, | |
| 5335 | − | "add_commit_comment", | |
| 5336 | − | &AddCommitCommentArgs { actor: actor(), repo, commit, body, path, line }, | |
| 5337 | − | ) | |
| 5338 | − | .await | |
| 5339 | − | } | |
| 5340 | − | Op::UpdateCommitComment | Op::DeleteCommitComment => { | |
| 5341 | − | let editing = self == Op::UpdateCommitComment; | |
| 5342 | − | let body = text(input, "body"); | |
| 5343 | − | if editing && body.trim().is_empty() { | |
| 5344 | − | return failed(FailureCode::Invalid, "Give body: the new text, in Markdown."); | |
| 5345 | − | } | |
| 5346 | − | let asked = CommitCommentArgs { actor: actor(), repo, id: text(input, "comment_id"), body }; | |
| 5347 | − | let method = if editing { "edit_commit_comment" } else { "delete_commit_comment" }; | |
| 5348 | − | pass(work, method, &asked).await | |
| 5349 | − | } | |
| 4753 | + | Op::MergePullRequest => pass(work, "merge_pull", &pull_action()).await, | |
| 5350 | 4754 | Op::GetPullRequestChanges => { | |
| 5351 | 4755 | let found: Outcome<PullDetail> = call(work, "get_pull", &view()).await?; | |
| 5352 | 4756 | match found { | |
| 26 | 26 | SetForkPrApproval, | |
| 27 | 27 | GetActionsAccess, | |
| 28 | 28 | SetActionsAccess, | |
| 29 | − | GetActionsPermissions, | |
| 30 | − | SetActionsPermissions, | |
| 31 | 29 | CreateRepositoryDispatch, | |
| 32 | 30 | GetWorkspaceWorkflowPermissions, | |
| 33 | 31 | SetWorkspaceWorkflowPermissions, | |
| ⋯ | |||
| 41 | 39 | /// Every one: `Op::ALL` lists each as `Op::Protection(…)`, which a test | |
| 42 | 40 | /// checks against this. | |
| 43 | 41 | #[cfg(test)] | |
| 44 | − | pub const ALL: [ProtectionOp; 20] = [ | |
| 42 | + | pub const ALL: [ProtectionOp; 18] = [ | |
| 45 | 43 | ProtectionOp::UpdateEnvironment, | |
| 46 | 44 | ProtectionOp::DeleteEnvironment, | |
| 47 | 45 | ProtectionOp::GetPendingDeployments, | |
| ⋯ | |||
| 53 | 51 | ProtectionOp::SetForkPrApproval, | |
| 54 | 52 | ProtectionOp::GetActionsAccess, | |
| 55 | 53 | ProtectionOp::SetActionsAccess, | |
| 56 | − | ProtectionOp::GetActionsPermissions, | |
| 57 | − | ProtectionOp::SetActionsPermissions, | |
| 58 | 54 | ProtectionOp::CreateRepositoryDispatch, | |
| 59 | 55 | ProtectionOp::GetWorkspaceWorkflowPermissions, | |
| 60 | 56 | ProtectionOp::SetWorkspaceWorkflowPermissions, | |
| ⋯ | |||
| 77 | 73 | ProtectionOp::SetForkPrApproval => "set_fork_pr_approval", | |
| 78 | 74 | ProtectionOp::GetActionsAccess => "get_actions_access", | |
| 79 | 75 | ProtectionOp::SetActionsAccess => "set_actions_access", | |
| 80 | − | ProtectionOp::GetActionsPermissions => "get_actions_permissions", | |
| 81 | − | ProtectionOp::SetActionsPermissions => "set_actions_permissions", | |
| 82 | 76 | ProtectionOp::CreateRepositoryDispatch => "create_repository_dispatch", | |
| 83 | 77 | ProtectionOp::GetWorkspaceWorkflowPermissions => "get_workspace_workflow_permissions", | |
| 84 | 78 | ProtectionOp::SetWorkspaceWorkflowPermissions => "set_workspace_workflow_permissions", | |
| ⋯ | |||
| 119 | 113 | ProtectionOp::SetForkPrApproval => "Set the approval policy for outside pull requests", | |
| 120 | 114 | ProtectionOp::GetActionsAccess => "Get who may use a repository's actions and workflows", | |
| 121 | 115 | ProtectionOp::SetActionsAccess => "Set who may use a repository's actions and workflows", | |
| 122 | − | ProtectionOp::GetActionsPermissions => "Get whether a repository's workflows run", | |
| 123 | − | ProtectionOp::SetActionsPermissions => "Turn a repository's workflows on or off", | |
| 124 | 116 | ProtectionOp::CreateRepositoryDispatch => "Create a repository dispatch event", | |
| 125 | 117 | ProtectionOp::GetWorkspaceWorkflowPermissions => "Get a workspace's default workflow permissions", | |
| 126 | 118 | ProtectionOp::SetWorkspaceWorkflowPermissions => "Set a workspace's default workflow permissions", | |
| ⋯ | |||
| 144 | 136 | ProtectionOp::SetForkPrApproval => "Set approval_policy: first_time_contributors, outside_contributors or all_external_contributors. Needs the Admin role.", | |
| 145 | 137 | ProtectionOp::GetActionsAccess => "Which other repositories' workflows may use this private repository's actions (uses: owner/repo@ref) and reusable workflows (jobs.<id>.uses: owner/repo/.g1t/workflows/build.yml@ref): access_level is none (the default: only this repository) or organization (private repositories in the same workspace). A public repository's actions and workflows are anyone's, whatever this says, and a public repository's workflows never use a private one's. Needs the Read role.", | |
| 146 | 138 | ProtectionOp::SetActionsAccess => "Set access_level: none, or organization to let the workspace's other private repositories use this repository's actions and reusable workflows (user is read as organization). Needs the Admin role.", | |
| 147 | − | ProtectionOp::GetActionsPermissions => "Whether a repository's workflows run at all: enabled is on for a repository and off for a fork until someone chooses (enabled_chosen says whether anyone has), so a fork never runs the workflows it copied until they are turned on. While it is off, no push, pull request, schedule, dispatch, repository_dispatch, merge queue or re-run starts a run; its workflows stay listed. allowed_actions is always all. Needs the Read role.", | |
| 148 | − | ProtectionOp::SetActionsPermissions => "Turn a repository's workflows on or off (enabled). Off, nothing starts a run, and a dispatch or re-run is refused with \"Actions is turned off for owner/name\"; runs already going finish. Turning it on runs nothing by itself: the next event does. Needs the Admin role; a workflow job's own token cannot.", | |
| 149 | 139 | ProtectionOp::GetWorkspaceWorkflowPermissions => "A workspace's policy for its repositories' job tokens: default_workflow_permissions (read, the default, or write) is what a repository made from now on gets until it chooses; max_workflow_permissions (write, the default, or read) is the most any repository's default may be, so read holds every repository to read-only; can_approve_pull_request_reviews (off by default) lets its repositories allow jobs to open and approve pull requests. Members only.", | |
| 150 | 140 | ProtectionOp::SetWorkspaceWorkflowPermissions => "Change a workspace's default_workflow_permissions, max_workflow_permissions and can_approve_pull_request_reviews; fields left out stay as they are. A maximum of read makes the default read too. Owners only.", | |
| 151 | 141 | ProtectionOp::ListWorkspaceManagedWorkflows => "The workflows a workspace's owners added to its repositories, g1t's required workflows: each runs in every repository it targets as that repository's own workflow (its token, its secrets, its checks), under the path managed/<name>.yml, from a copy of its source file taken when it was saved. Each has name, path, workflow_name (its `name:`), source (owner/repo/path@ref), source_sha (the commit it was copied at), source_private, mode, repositories, visibility, content (the copy that runs) and when and by whom it was last saved. Owners only.", | |
| ⋯ | |||
| 164 | 154 | | ProtectionOp::GetWorkflowPermissions | |
| 165 | 155 | | ProtectionOp::GetForkPrApproval | |
| 166 | 156 | | ProtectionOp::GetActionsAccess | |
| 167 | − | | ProtectionOp::GetActionsPermissions | |
| 168 | 157 | | ProtectionOp::GetWorkspaceWorkflowPermissions | |
| 169 | 158 | | ProtectionOp::ListWorkspaceManagedWorkflows | |
| 170 | 159 | ) | |
| ⋯ | |||
| 228 | 217 | }), | |
| 229 | 218 | &["repo", "id", "state"], | |
| 230 | 219 | ), | |
| 231 | − | ProtectionOp::GetWorkflowPermissions | |
| 232 | − | | ProtectionOp::GetForkPrApproval | |
| 233 | − | | ProtectionOp::GetActionsAccess | |
| 234 | − | | ProtectionOp::GetActionsPermissions => (json!({ "repo": repo }), &["repo"]), | |
| 235 | − | ProtectionOp::SetActionsPermissions => ( | |
| 236 | − | json!({ | |
| 237 | − | "repo": repo, | |
| 238 | − | "enabled": { "type": "boolean", "description": "Whether its workflows run." }, | |
| 239 | − | }), | |
| 240 | − | &["repo", "enabled"], | |
| 241 | − | ), | |
| 220 | + | ProtectionOp::GetWorkflowPermissions | ProtectionOp::GetForkPrApproval | ProtectionOp::GetActionsAccess => (json!({ "repo": repo }), &["repo"]), | |
| 242 | 221 | ProtectionOp::SetActionsAccess => ( | |
| 243 | 222 | json!({ | |
| 244 | 223 | "repo": repo, | |
| ⋯ | |||
| 734 | 713 | .await? | |
| 735 | 714 | }; | |
| 736 | 715 | map(settings, |s| json!({ "access_level": s["accessLevel"] })) | |
| 737 | − | } | |
| 738 | − | ProtectionOp::GetActionsPermissions | ProtectionOp::SetActionsPermissions => { | |
| 739 | − | let settings: Outcome<Value> = if op == ProtectionOp::GetActionsPermissions { | |
| 740 | − | g1t_kit::call(actions, "actions_settings", &json!({ "viewer": viewer, "repo": repo })).await? | |
| 741 | − | } else { | |
| 742 | − | let Some(enabled) = flag(input, "enabled") else { | |
| 743 | − | return Ok(Outcome::fail(FailureCode::Invalid, "enabled is true or false.")); | |
| 744 | − | }; | |
| 745 | − | g1t_kit::call(actions, "set_actions_settings", &json!({ "actor": actor(), "repo": repo, "enabled": enabled })).await? | |
| 746 | − | }; | |
| 747 | − | map(settings, |s| { | |
| 748 | − | json!({ | |
| 749 | − | "enabled": s.get("enabled").cloned().unwrap_or(Value::Bool(true)), | |
| 750 | − | "enabled_chosen": s.get("enabledChosen").cloned().unwrap_or(Value::Bool(false)), | |
| 751 | − | "allowed_actions": "all", | |
| 752 | − | }) | |
| 753 | − | }) | |
| 754 | 716 | } | |
| 755 | 717 | ProtectionOp::CreateRepositoryDispatch => { | |
| 756 | 718 | let started: Outcome<u32> = g1t_kit::call( | |
| 707 | 707 | "website": "https://hello.g1t.page", | |
| 708 | 708 | "archived_at": null | |
| 709 | 709 | }, | |
| 710 | − | "notes": "Only the fields given change. `website` gets `https://` when no scheme is given; an empty string clears it. `default_branch` must name a branch that exists (`422` otherwise); it is changed after the other fields. `description`, `website`, `topics` and `protected` need the Maintain role or higher, and `private`, `allow_forking`, `max_ref_updates` and `default_branch` the Admin role (`403` otherwise, saying which role). Changing `private` here needs no confirmation; `POST /repos/{owner}/{name}/visibility` asks for one. Making it private is refused with `402` when a free workspace's private storage has no room for it. A fork cannot change `private` (`422`): detach it first. See [Managing a repository](/guides/managing-repositories/) and [Access and roles](/guides/access-and-roles/)." | |
| 710 | + | "notes": "Only the fields given change. `website` gets `https://` when no scheme is given; an empty string clears it. `default_branch` must name a branch that exists (`422` otherwise); it is changed after the other fields. `description`, `website`, `topics` and `protected` need the Maintain role or higher, and `private` and `default_branch` the Admin role (`403` otherwise, saying which role). Changing `private` here needs no confirmation; `POST /repos/{owner}/{name}/visibility` asks for one. Making it private is refused with `402` when a free workspace's private storage has no room for it. See [Managing a repository](/guides/managing-repositories/) and [Access and roles](/guides/access-and-roles/)." | |
| 711 | 711 | }, | |
| 712 | 712 | "transfer_repo": { | |
| 713 | 713 | "request": { | |
| ⋯ | |||
| 728 | 728 | "archived_at": null | |
| 729 | 729 | }, | |
| 730 | 730 | "notes": "The repository at its new address. Refused with `409` when the destination already has a repository of that name, `403` unless you own both workspaces, and `402` when a free destination has no room for a private repository. The old address redirects. See [Transferring a repository](/guides/transferring-repositories/)." | |
| 731 | − | }, | |
| 732 | − | "fork_repo": { | |
| 733 | − | "request": { | |
| 734 | − | "workspace": "ada", | |
| 735 | − | "default_branch_only": true | |
| 736 | − | }, | |
| 737 | − | "response": { | |
| 738 | − | "id": "rep_01m4b7k2v9c3tq8x5n6d0fr1hz", | |
| 739 | − | "namespace": "ada", | |
| 740 | − | "name": "hello", | |
| 741 | − | "description": "A tiny service that says hello.", | |
| 742 | − | "is_private": false, | |
| 743 | − | "owner_id": "usr_01kq3r8w2m6vd5e9t0hy7jx4cb", | |
| 744 | − | "default_branch": "main", | |
| 745 | − | "fork_of": null, | |
| 746 | − | "parent_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 747 | − | "parent": { | |
| 748 | − | "namespace": "flagon-io", | |
| 749 | − | "name": "hello" | |
| 750 | − | }, | |
| 751 | − | "allow_forking": false, | |
| 752 | − | "protected": false, | |
| 753 | − | "created_at": "2026-10-14T09:30:12.418Z", | |
| 754 | − | "website": null, | |
| 755 | − | "archived_at": null | |
| 756 | − | }, | |
| 757 | − | "notes": "The new fork, with `parent` naming the repository it came from. Refused with `403` when the repository is private and its admins have not allowed forking, or when you cannot create repositories in the workspace; `409` when the workspace already has a repository of that name (give another `name`); `402` when a free workspace's private storage has no room for a private fork. Its code and description are copied; nothing else is. See [Forking a repository](/guides/forking-repositories/) and [Forks](/concepts/forks/)." | |
| 758 | − | }, | |
| 759 | − | "list_forks": { | |
| 760 | − | "query": { | |
| 761 | − | "limit": "30" | |
| 762 | − | }, | |
| 763 | − | "response": [ | |
| 764 | − | { | |
| 765 | − | "id": "rep_01m4b7k2v9c3tq8x5n6d0fr1hz", | |
| 766 | − | "namespace": "ada", | |
| 767 | − | "name": "hello", | |
| 768 | − | "description": "A tiny service that says hello.", | |
| 769 | − | "is_private": false, | |
| 770 | − | "owner_id": "usr_01kq3r8w2m6vd5e9t0hy7jx4cb", | |
| 771 | − | "default_branch": "main", | |
| 772 | − | "fork_of": null, | |
| 773 | − | "parent_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 774 | − | "parent": { | |
| 775 | − | "namespace": "flagon-io", | |
| 776 | − | "name": "hello" | |
| 777 | − | }, | |
| 778 | − | "allow_forking": false, | |
| 779 | − | "protected": false, | |
| 780 | − | "created_at": "2026-10-14T09:30:12.418Z", | |
| 781 | − | "website": null, | |
| 782 | − | "archived_at": null | |
| 783 | − | } | |
| 784 | − | ], | |
| 785 | − | "notes": "Only the forks you can read, newest first: a private repository's forks are listed for people who can read them. Forks of a fork are listed on that fork. See [Forks](/concepts/forks/)." | |
| 786 | 731 | }, | |
| 787 | − | "sync_fork": { | |
| 788 | − | "request": { | |
| 789 | − | "branch": "main" | |
| 790 | − | }, | |
| 791 | − | "response": { | |
| 792 | − | "status": "fast_forwarded", | |
| 793 | − | "branch": "main", | |
| 794 | − | "head": "9c4e1f0b7a2d3e5f6a8b9c0d1e2f3a4b5c6d7e8f", | |
| 795 | − | "behind": 3, | |
| 796 | − | "ahead": 0, | |
| 797 | − | "conflicts": [] | |
| 798 | − | }, | |
| 799 | − | "notes": "`status` is `up_to_date`, `fast_forwarded`, `merged` (a merge commit joins the fork's own commits and the parent's) or `conflicted`: both sides changed the files in `conflicts`, and nothing was changed. Merge the parent's branch in a clone and push. Refused with `422` when the repository is not a fork, `403` without the Write role on it, and `404` when its parent is gone or you can no longer read it. See [Sync a fork](/guides/forking-repositories/#sync-a-fork)." | |
| 800 | − | }, | |
| 801 | − | "detach_fork": { | |
| 802 | − | "response": { | |
| 803 | − | "id": "rep_01m4b7k2v9c3tq8x5n6d0fr1hz", | |
| 804 | − | "namespace": "ada", | |
| 805 | − | "name": "hello", | |
| 806 | − | "description": "A tiny service that says hello.", | |
| 807 | − | "is_private": false, | |
| 808 | − | "owner_id": "usr_01kq3r8w2m6vd5e9t0hy7jx4cb", | |
| 809 | − | "default_branch": "main", | |
| 810 | − | "fork_of": null, | |
| 811 | − | "parent_id": null, | |
| 812 | − | "parent": null, | |
| 813 | − | "allow_forking": false, | |
| 814 | − | "protected": false, | |
| 815 | − | "created_at": "2026-10-14T09:30:12.418Z", | |
| 816 | − | "website": null, | |
| 817 | − | "archived_at": null | |
| 818 | − | }, | |
| 819 | − | "notes": "The repository, now with no parent. Needs the Admin role (`403` otherwise); `422` when it is not a fork. It cannot be attached again. See [Detach a fork](/guides/forking-repositories/#detach-a-fork)." | |
| 820 | − | }, | |
| 821 | 732 | "rename_repo": { | |
| 822 | 733 | "request": { | |
| 823 | 734 | "name": "greeter" | |
| ⋯ | |||
| 1035 | 946 | "allow_ignoring_checks": true, | |
| 1036 | 947 | "merge_queue": false, | |
| 1037 | 948 | "require_code_owner_review": false, | |
| 1038 | − | "has_issues": null, | |
| 1039 | − | "issues_enabled": true, | |
| 1040 | − | "allow_merge_commit": true, | |
| 1041 | − | "allow_squash_merge": true, | |
| 1042 | − | "allow_rebase_merge": true, | |
| 1043 | − | "allow_fast_forward": false, | |
| 1044 | − | "default_merge_method": "merge", | |
| 1045 | − | "merge_commit_message": "default", | |
| 1046 | − | "squash_commit_message": "default", | |
| 1047 | − | "merge_commit_template": null, | |
| 1048 | − | "squash_commit_template": null, | |
| 1049 | − | "suggest_updating_branches": true, | |
| 1050 | − | "allow_auto_merge": true, | |
| 1051 | − | "delete_branch_on_merge": false, | |
| 1052 | − | "require_web_commit_sign_off": false, | |
| 1053 | − | "allow_commit_comments": true, | |
| 1054 | − | "auto_close_issues": true, | |
| 1055 | 949 | "updated_by": null, | |
| 1056 | 950 | "updated_at": null | |
| 1057 | 951 | } | |
| ⋯ | |||
| 1065 | 959 | "required_approvals": 1, | |
| 1066 | 960 | "count_agent_approvals": false, | |
| 1067 | 961 | "merge_queue": true, | |
| 1068 | − | "require_code_owner_review": true, | |
| 1069 | − | "allow_merge_commit": false, | |
| 1070 | − | "default_merge_method": "squash", | |
| 1071 | − | "squash_commit_message": "pull_title_and_description", | |
| 1072 | − | "delete_branch_on_merge": true | |
| 962 | + | "require_code_owner_review": true | |
| 1073 | 963 | }, | |
| 1074 | 964 | "response": { | |
| 1075 | 965 | "auto_merge": false, | |
| ⋯ | |||
| 1083 | 973 | "allow_ignoring_checks": true, | |
| 1084 | 974 | "merge_queue": true, | |
| 1085 | 975 | "require_code_owner_review": true, | |
| 1086 | − | "has_issues": null, | |
| 1087 | − | "issues_enabled": true, | |
| 1088 | − | "allow_merge_commit": false, | |
| 1089 | − | "allow_squash_merge": true, | |
| 1090 | − | "allow_rebase_merge": true, | |
| 1091 | − | "allow_fast_forward": false, | |
| 1092 | − | "default_merge_method": "squash", | |
| 1093 | − | "merge_commit_message": "default", | |
| 1094 | − | "squash_commit_message": "pull_title_and_description", | |
| 1095 | − | "merge_commit_template": null, | |
| 1096 | − | "squash_commit_template": null, | |
| 1097 | − | "suggest_updating_branches": true, | |
| 1098 | − | "allow_auto_merge": true, | |
| 1099 | − | "delete_branch_on_merge": true, | |
| 1100 | − | "require_web_commit_sign_off": false, | |
| 1101 | − | "allow_commit_comments": true, | |
| 1102 | − | "auto_close_issues": true, | |
| 1103 | 976 | "updated_by": "syntaqx", | |
| 1104 | 977 | "updated_at": "2026-10-04T16:20:37.508Z" | |
| 1105 | 978 | }, | |
| 1106 | − | "notes": "`required_checks` replaces the whole list: at most 20 names, each a workflow's name or another status's context, as [`list_check_names`](/reference/api/repositories/list-check-names/) gives them. A pull request merges only once each passes on its head; one nothing has reported holds it too. With the merge queue on, each must also pass on the queued state, so the workflows behind them need `merge_group` in their `on:`. `required_approvals` is at most 6. See [what a repository can ask for](/guides/working-with-g1t/#what-a-repository-can-ask-for). With `require_code_owner_review`, a pull request into the default branch merges only once the code owners of every file it changes have approved it, as many as each section of its CODEOWNERS file asks: see [Code owners](/guides/codeowners/). At least one of `allow_merge_commit`, `allow_squash_merge`, `allow_rebase_merge` and `allow_fast_forward` stays on, and `default_merge_method` must be one of them (`422` otherwise). `merge_commit_template` and `squash_commit_template` are used with `custom`: see [Commit messages](/guides/pull-requests/#commit-messages) for their placeholders. `has_issues` `null` goes back to the default: on for a repository, off for a fork. See [Repository settings](/guides/managing-repositories/#settings)." | |
| 979 | + | "notes": "`required_checks` replaces the whole list: at most 20 names, each a workflow's name or another status's context, as [`list_check_names`](/reference/api/repositories/list-check-names/) gives them. A pull request merges only once each passes on its head; one nothing has reported holds it too. With the merge queue on, each must also pass on the queued state, so the workflows behind them need `merge_group` in their `on:`. `required_approvals` is at most 6. See [what a repository can ask for](/guides/working-with-g1t/#what-a-repository-can-ask-for). With `require_code_owner_review`, a pull request into the default branch merges only once the code owners of every file it changes have approved it, as many as each section of its CODEOWNERS file asks: see [Code owners](/guides/codeowners/)." | |
| 1107 | 980 | }, | |
| 1108 | 981 | "list_check_names": { | |
| 1109 | 982 | "response": [ | |
| ⋯ | |||
| 2177 | 2050 | }, | |
| 2178 | 2051 | "notes": "Takes them off who is asked; anyone not asked is ignored. Reviews they already gave stay, as do the people a team's review assignment picked: remove them by username." | |
| 2179 | 2052 | }, | |
| 2180 | − | "get_pull_request_merge_options": { | |
| 2181 | − | "response": { | |
| 2182 | − | "methods": [ | |
| 2183 | − | "merge", | |
| 2184 | − | "squash", | |
| 2185 | − | "rebase" | |
| 2186 | − | ], | |
| 2187 | − | "default_method": "squash", | |
| 2188 | − | "options": [ | |
| 2189 | − | { | |
| 2190 | − | "method": "merge", | |
| 2191 | − | "commit_title": "Merge pull request #14 from flagon-io/greet-caller", | |
| 2192 | − | "commit_message": "Greeting should name the caller", | |
| 2193 | − | "unavailable": null | |
| 2194 | − | }, | |
| 2195 | − | { | |
| 2196 | − | "method": "squash", | |
| 2197 | − | "commit_title": "Greeting should name the caller (#14)", | |
| 2198 | − | "commit_message": "* Read the name from the first argument\n* Fall back to \"world\"", | |
| 2199 | − | "unavailable": null | |
| 2200 | − | }, | |
| 2201 | − | { | |
| 2202 | − | "method": "rebase", | |
| 2203 | − | "commit_title": null, | |
| 2204 | − | "commit_message": null, | |
| 2205 | − | "unavailable": null | |
| 2206 | − | } | |
| 2207 | − | ], | |
| 2208 | − | "behind": false, | |
| 2209 | − | "can_fast_forward": false, | |
| 2210 | − | "suggest_update": false, | |
| 2211 | − | "require_up_to_date": false, | |
| 2212 | − | "merge_queue": false, | |
| 2213 | − | "auto_merge_allowed": true, | |
| 2214 | − | "delete_branch_default": true, | |
| 2215 | − | "can_delete_branch": true, | |
| 2216 | − | "sign_off": false | |
| 2217 | − | }, | |
| 2218 | − | "notes": "`methods` are the repository's allowed methods, narrowed by the rules for the branch it merges into: required linear history leaves out `merge`. `fast_forward` lists `unavailable` until the branch contains its base's head. `merge` and `squash` carry the commit message a merge would use if you wrote none. See [Merging a pull request](/guides/pull-requests/#merging-a-pull-request)." | |
| 2219 | − | }, | |
| 2220 | 2053 | "merge_pull_request": { | |
| 2221 | 2054 | "request": { | |
| 2222 | − | "merge_method": "squash", | |
| 2223 | − | "commit_title": "Greeting names the caller (#14)", | |
| 2224 | − | "sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2225 | − | "delete_branch": true | |
| 2055 | + | "keep_issue_open": false | |
| 2226 | 2056 | }, | |
| 2227 | 2057 | "response": { | |
| 2228 | 2058 | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| ⋯ | |||
| 2244 | 2074 | "merge_base": "3a7e9c1b5d2f4a6c8e0b2d4f6a8c0e2b4d6f8a1c", | |
| 2245 | 2075 | "merged_by": "syntaqx", | |
| 2246 | 2076 | "merged_at": "2026-10-01T18:52:17.093Z", | |
| 2247 | − | "merge_method": "squash", | |
| 2248 | − | "merge_commit": "c41d7e2a9b0f3e5d7c9a1b3d5f7e9c0a2b4d6f81", | |
| 2249 | − | "closes": [ | |
| 2250 | − | 12 | |
| 2251 | − | ], | |
| 2252 | 2077 | "superseded_by": null, | |
| 2253 | 2078 | "check_status": "passed", | |
| 2254 | 2079 | "files": [ | |
| ⋯ | |||
| 2277 | 2102 | "created_at": "2026-10-01T18:20:02.117Z", | |
| 2278 | 2103 | "updated_at": "2026-10-01T18:52:17.093Z" | |
| 2279 | 2104 | }, | |
| 2280 | − | "notes": "A draft, or one whose checks have not passed, answers `409`. A pull request still `open` in the response has not landed yet: `landing` is true on it while it is brought up to date, and [get the merge queue](/reference/api/pull-requests/get-merge-queue/) shows it waiting in the [merge queue](/guides/merge-queue/). Merging records the pull request in the issue's `resolved_by`, closes the issues in `closes` (into the default branch, where `auto_close_issues` is on) and sets `superseded_by` on the pull requests it closes. A `merge_method` the repository or a rule for the base does not allow answers `422`, and a head that moved since `sha`, `409`. `merge_commit` is the commit the base is at afterwards: the merge or squash commit, the last rebased one, or the head for a fast-forward. See [Merging a pull request](/guides/pull-requests/#merging-a-pull-request)." | |
| 2281 | − | }, | |
| 2282 | − | "update_pull_request_branch": { | |
| 2283 | − | "request": { | |
| 2284 | − | "expected_head_sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2285 | − | "update_method": "merge" | |
| 2286 | − | }, | |
| 2287 | − | "response": { | |
| 2288 | − | "outcome": "updated", | |
| 2289 | − | "commit": "5b8d0f2a4c6e8a0c2e4a6c8e0a2c4e6a8c0e2a4c", | |
| 2290 | − | "previous": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13" | |
| 2291 | − | }, | |
| 2292 | − | "notes": "`outcome` is `updated` (its branch moved from `previous` to `commit`), `up_to_date` (it already holds its base's head; `commit` only) or `needs_agent` (nothing was pushed: `reason` is `overlap`, `conflicting` or `unsupported`, with `detail` and the `paths` concerned). `update_method` `rebase` rewrites its branch, so pull it again before pushing more. A head that moved since `expected_head_sha` answers `409`. See [Keeping a pull request up to date](/guides/pull-requests/#keeping-it-up-to-date)." | |
| 2293 | − | }, | |
| 2294 | − | "enable_pull_request_auto_merge": { | |
| 2295 | − | "request": { | |
| 2296 | − | "merge_method": "squash", | |
| 2297 | − | "commit_title": "Greeting names the caller (#14)" | |
| 2298 | − | }, | |
| 2299 | − | "response": { | |
| 2300 | − | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| 2301 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2302 | − | "number": 14, | |
| 2303 | − | "issue": 12, | |
| 2304 | − | "title": "Greeting should name the caller", | |
| 2305 | − | "body": "Reads a name from the first argument. `hello ana` prints \"Hello, ana!\".", | |
| 2306 | − | "agent": "claude-code", | |
| 2307 | − | "runtime": "external", | |
| 2308 | − | "status": "open", | |
| 2309 | − | "fork": { | |
| 2310 | − | "namespace": "pulls", | |
| 2311 | − | "name": "pr_01m43smh3vexsr5pmp60qwv0vs" | |
| 2312 | − | }, | |
| 2313 | − | "fork_repo_id": "rep_01m43smh5xd7aw2kq9tv0b4c8e", | |
| 2314 | − | "branch": null, | |
| 2315 | − | "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2316 | − | "merge_base": "3a7e9c1b5d2f4a6c8e0b2d4f6a8c0e2b4d6f8a1c", | |
| 2317 | − | "merged_by": null, | |
| 2318 | − | "merged_at": null, | |
| 2319 | − | "superseded_by": null, | |
| 2320 | − | "check_status": "running", | |
| 2321 | − | "files": [ | |
| 2322 | − | { | |
| 2323 | − | "path": "src/main.rs", | |
| 2324 | − | "additions": 6, | |
| 2325 | − | "deletions": 2 | |
| 2326 | − | } | |
| 2327 | − | ], | |
| 2328 | − | "assignees": [], | |
| 2329 | − | "reviewers": [ | |
| 2330 | − | "ana" | |
| 2331 | − | ], | |
| 2332 | − | "labels": [], | |
| 2333 | − | "milestone": null, | |
| 2334 | − | "base": "main", | |
| 2335 | − | "author": { | |
| 2336 | − | "id": "usr_01kkntcg1eeb98j62xjm7eh09p", | |
| 2337 | − | "username": "syntaqx", | |
| 2338 | − | "display_username": "syntaqx", | |
| 2339 | − | "kind": "user", | |
| 2340 | − | "verified": false, | |
| 2341 | − | "workspaces": [] | |
| 2342 | − | }, | |
| 2343 | − | "requested_by": null, | |
| 2344 | − | "created_at": "2026-10-01T18:20:02.117Z", | |
| 2345 | − | "updated_at": "2026-10-01T18:44:09.310Z", | |
| 2346 | − | "auto_merge": { | |
| 2347 | − | "method": "squash", | |
| 2348 | − | "commit_title": "Greeting names the caller (#14)", | |
| 2349 | − | "commit_message": null, | |
| 2350 | − | "enabled_by": "syntaqx", | |
| 2351 | − | "enabled_at": "2026-10-01T18:44:09.310Z" | |
| 2352 | − | }, | |
| 2353 | − | "closes": [ | |
| 2354 | − | 12 | |
| 2355 | − | ] | |
| 2356 | − | }, | |
| 2357 | − | "notes": "A repository with `allow_auto_merge` off answers `422`, as does a method it or a rule for the base does not allow. A pull request that may already merge merges at once: check `status`. `auto_merge` is cleared when it merges or closes, when it is turned off, and when someone other than `enabled_by` pushes to it. See [Auto-merge](/guides/pull-requests/#auto-merge)." | |
| 2358 | − | }, | |
| 2359 | − | "disable_pull_request_auto_merge": { | |
| 2360 | − | "response": { | |
| 2361 | − | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| 2362 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2363 | − | "number": 14, | |
| 2364 | − | "issue": 12, | |
| 2365 | − | "title": "Greeting should name the caller", | |
| 2366 | − | "body": "Reads a name from the first argument. `hello ana` prints \"Hello, ana!\".", | |
| 2367 | − | "agent": "claude-code", | |
| 2368 | − | "runtime": "external", | |
| 2369 | − | "status": "open", | |
| 2370 | − | "fork": { | |
| 2371 | − | "namespace": "pulls", | |
| 2372 | − | "name": "pr_01m43smh3vexsr5pmp60qwv0vs" | |
| 2373 | − | }, | |
| 2374 | − | "fork_repo_id": "rep_01m43smh5xd7aw2kq9tv0b4c8e", | |
| 2375 | − | "branch": null, | |
| 2376 | − | "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2377 | − | "merge_base": "3a7e9c1b5d2f4a6c8e0b2d4f6a8c0e2b4d6f8a1c", | |
| 2378 | − | "merged_by": null, | |
| 2379 | − | "merged_at": null, | |
| 2380 | − | "superseded_by": null, | |
| 2381 | − | "check_status": "running", | |
| 2382 | − | "files": [ | |
| 2383 | − | { | |
| 2384 | − | "path": "src/main.rs", | |
| 2385 | − | "additions": 6, | |
| 2386 | − | "deletions": 2 | |
| 2387 | − | } | |
| 2388 | − | ], | |
| 2389 | − | "assignees": [], | |
| 2390 | − | "reviewers": [ | |
| 2391 | − | "ana" | |
| 2392 | − | ], | |
| 2393 | − | "labels": [], | |
| 2394 | − | "milestone": null, | |
| 2395 | − | "base": "main", | |
| 2396 | − | "author": { | |
| 2397 | − | "id": "usr_01kkntcg1eeb98j62xjm7eh09p", | |
| 2398 | − | "username": "syntaqx", | |
| 2399 | − | "display_username": "syntaqx", | |
| 2400 | − | "kind": "user", | |
| 2401 | − | "verified": false, | |
| 2402 | − | "workspaces": [] | |
| 2403 | − | }, | |
| 2404 | − | "requested_by": null, | |
| 2405 | − | "created_at": "2026-10-01T18:20:02.117Z", | |
| 2406 | − | "updated_at": "2026-10-01T18:44:09.310Z", | |
| 2407 | − | "auto_merge": null, | |
| 2408 | − | "closes": [ | |
| 2409 | − | 12 | |
| 2410 | − | ] | |
| 2411 | − | } | |
| 2412 | − | }, | |
| 2413 | − | "delete_pull_request_head_branch": { | |
| 2414 | − | "response": { | |
| 2415 | − | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| 2416 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2417 | − | "number": 14, | |
| 2418 | − | "issue": 12, | |
| 2419 | − | "title": "Greeting should name the caller", | |
| 2420 | − | "body": "Reads a name from the first argument. `hello ana` prints \"Hello, ana!\".", | |
| 2421 | − | "agent": "claude-code", | |
| 2422 | − | "runtime": "external", | |
| 2423 | − | "status": "merged", | |
| 2424 | − | "fork": null, | |
| 2425 | − | "fork_repo_id": null, | |
| 2426 | − | "branch": "greet-caller", | |
| 2427 | − | "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2428 | − | "merge_base": "3a7e9c1b5d2f4a6c8e0b2d4f6a8c0e2b4d6f8a1c", | |
| 2429 | − | "merged_by": "syntaqx", | |
| 2430 | − | "merged_at": "2026-10-01T18:52:17.093Z", | |
| 2431 | − | "superseded_by": null, | |
| 2432 | − | "check_status": "passed", | |
| 2433 | − | "files": [ | |
| 2434 | − | { | |
| 2435 | − | "path": "src/main.rs", | |
| 2436 | − | "additions": 6, | |
| 2437 | − | "deletions": 2 | |
| 2438 | − | } | |
| 2439 | − | ], | |
| 2440 | − | "assignees": [], | |
| 2441 | − | "reviewers": [ | |
| 2442 | − | "ana" | |
| 2443 | − | ], | |
| 2444 | − | "labels": [], | |
| 2445 | − | "milestone": null, | |
| 2446 | − | "base": "main", | |
| 2447 | − | "author": { | |
| 2448 | − | "id": "usr_01kkntcg1eeb98j62xjm7eh09p", | |
| 2449 | − | "username": "syntaqx", | |
| 2450 | − | "display_username": "syntaqx", | |
| 2451 | − | "kind": "user", | |
| 2452 | − | "verified": false, | |
| 2453 | − | "workspaces": [] | |
| 2454 | − | }, | |
| 2455 | − | "requested_by": null, | |
| 2456 | − | "created_at": "2026-10-01T18:20:02.117Z", | |
| 2457 | − | "updated_at": "2026-10-01T18:53:02.415Z", | |
| 2458 | − | "merge_method": "squash", | |
| 2459 | − | "merge_commit": "c41d7e2a9b0f3e5d7c9a1b3d5f7e9c0a2b4d6f81", | |
| 2460 | − | "closes": [ | |
| 2461 | − | 12 | |
| 2462 | − | ], | |
| 2463 | − | "head_branch_deleted": true | |
| 2464 | − | }, | |
| 2465 | − | "notes": "An open pull request answers `409`: close or merge it first. `head_branch_deleted` is then `true`; [restore it](/reference/api/pull-requests/restore-pull-request-head-branch/) at `head_commit`." | |
| 2105 | + | "notes": "A draft, or one whose checks have not passed, answers `409`. A pull request still `open` in the response has not landed yet: `landing` is true on it while it is brought up to date, and [get the merge queue](/reference/api/pull-requests/get-merge-queue/) shows it waiting in the [merge queue](/guides/merge-queue/). Merging records the pull request in the issue's `resolved_by` and sets `superseded_by` on the pull requests it closes." | |
| 2466 | 2106 | }, | |
| 2467 | − | "restore_pull_request_head_branch": { | |
| 2468 | − | "response": { | |
| 2469 | − | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| 2470 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2471 | − | "number": 14, | |
| 2472 | − | "issue": 12, | |
| 2473 | − | "title": "Greeting should name the caller", | |
| 2474 | − | "body": "Reads a name from the first argument. `hello ana` prints \"Hello, ana!\".", | |
| 2475 | − | "agent": "claude-code", | |
| 2476 | − | "runtime": "external", | |
| 2477 | − | "status": "merged", | |
| 2478 | − | "fork": null, | |
| 2479 | − | "fork_repo_id": null, | |
| 2480 | − | "branch": "greet-caller", | |
| 2481 | − | "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2482 | − | "merge_base": "3a7e9c1b5d2f4a6c8e0b2d4f6a8c0e2b4d6f8a1c", | |
| 2483 | − | "merged_by": "syntaqx", | |
| 2484 | − | "merged_at": "2026-10-01T18:52:17.093Z", | |
| 2485 | − | "superseded_by": null, | |
| 2486 | − | "check_status": "passed", | |
| 2487 | − | "files": [ | |
| 2488 | − | { | |
| 2489 | − | "path": "src/main.rs", | |
| 2490 | − | "additions": 6, | |
| 2491 | − | "deletions": 2 | |
| 2492 | − | } | |
| 2493 | − | ], | |
| 2494 | − | "assignees": [], | |
| 2495 | − | "reviewers": [ | |
| 2496 | − | "ana" | |
| 2497 | − | ], | |
| 2498 | − | "labels": [], | |
| 2499 | − | "milestone": null, | |
| 2500 | − | "base": "main", | |
| 2501 | − | "author": { | |
| 2502 | − | "id": "usr_01kkntcg1eeb98j62xjm7eh09p", | |
| 2503 | − | "username": "syntaqx", | |
| 2504 | − | "display_username": "syntaqx", | |
| 2505 | − | "kind": "user", | |
| 2506 | − | "verified": false, | |
| 2507 | − | "workspaces": [] | |
| 2508 | − | }, | |
| 2509 | − | "requested_by": null, | |
| 2510 | − | "created_at": "2026-10-01T18:20:02.117Z", | |
| 2511 | − | "updated_at": "2026-10-02T09:10:44.902Z", | |
| 2512 | − | "merge_method": "squash", | |
| 2513 | − | "merge_commit": "c41d7e2a9b0f3e5d7c9a1b3d5f7e9c0a2b4d6f81", | |
| 2514 | − | "closes": [ | |
| 2515 | − | 12 | |
| 2516 | − | ], | |
| 2517 | − | "head_branch_deleted": false | |
| 2518 | − | }, | |
| 2519 | − | "notes": "The branch is made again at `head_commit`. A branch of that name that exists again answers `409`." | |
| 2520 | − | }, | |
| 2521 | − | "list_repo_commit_comments": { | |
| 2522 | − | "query": { | |
| 2523 | − | "page": 1 | |
| 2524 | − | }, | |
| 2525 | − | "response": [ | |
| 2526 | − | { | |
| 2527 | − | "id": "ccm_01m4a2s1b5c7e9g3k6m0p4s8v2", | |
| 2528 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2529 | − | "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2530 | − | "path": null, | |
| 2531 | − | "line": null, | |
| 2532 | − | "author": "syntaqx", | |
| 2533 | − | "body": "Released as v0.4.0.", | |
| 2534 | − | "created_at": "2026-10-02T08:30:57.664Z", | |
| 2535 | − | "updated_at": null | |
| 2536 | − | }, | |
| 2537 | − | { | |
| 2538 | − | "id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4", | |
| 2539 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2540 | − | "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2541 | − | "path": "src/main.rs", | |
| 2542 | − | "line": 12, | |
| 2543 | − | "author": "ana", | |
| 2544 | − | "body": "Should an empty name fall back to \"world\"?", | |
| 2545 | − | "created_at": "2026-10-01T19:02:11.208Z", | |
| 2546 | − | "updated_at": null | |
| 2547 | − | } | |
| 2548 | − | ], | |
| 2549 | − | "notes": "Newest first, 30 a page. A comment with `path` and `line` is on that line of the file as its `commit` left it; one without is on the whole commit." | |
| 2550 | − | }, | |
| 2551 | − | "list_commit_comments": { | |
| 2552 | − | "params": { | |
| 2553 | − | "owner": "flagon-io", | |
| 2554 | − | "name": "hello", | |
| 2555 | − | "sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13" | |
| 2556 | − | }, | |
| 2557 | − | "response": [ | |
| 2558 | − | { | |
| 2559 | − | "id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4", | |
| 2560 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2561 | − | "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2562 | − | "path": "src/main.rs", | |
| 2563 | − | "line": 12, | |
| 2564 | − | "author": "ana", | |
| 2565 | − | "body": "Should an empty name fall back to \"world\"?", | |
| 2566 | − | "created_at": "2026-10-01T19:02:11.208Z", | |
| 2567 | − | "updated_at": null | |
| 2568 | − | } | |
| 2569 | − | ], | |
| 2570 | − | "notes": "Oldest first." | |
| 2571 | − | }, | |
| 2572 | − | "create_commit_comment": { | |
| 2573 | − | "params": { | |
| 2574 | − | "owner": "flagon-io", | |
| 2575 | − | "name": "hello", | |
| 2576 | − | "sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13" | |
| 2577 | − | }, | |
| 2578 | − | "request": { | |
| 2579 | − | "body": "Should an empty name fall back to \"world\"?", | |
| 2580 | − | "path": "src/main.rs", | |
| 2581 | − | "line": 12 | |
| 2582 | − | }, | |
| 2583 | − | "response": { | |
| 2584 | − | "id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4", | |
| 2585 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2586 | − | "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2587 | − | "path": "src/main.rs", | |
| 2588 | − | "line": 12, | |
| 2589 | − | "author": "ana", | |
| 2590 | − | "body": "Should an empty name fall back to \"world\"?", | |
| 2591 | − | "created_at": "2026-10-01T19:02:11.208Z", | |
| 2592 | − | "updated_at": null | |
| 2593 | − | }, | |
| 2594 | − | "notes": "`line` needs `path`, a file the commit changed, and counts lines of that file as the commit left it. A repository with `allow_commit_comments` off answers `403`; a commit it does not have, `404`. See [Commit comments](/guides/pull-requests/#commit-comments)." | |
| 2595 | − | }, | |
| 2596 | − | "update_commit_comment": { | |
| 2597 | − | "params": { | |
| 2598 | − | "owner": "flagon-io", | |
| 2599 | − | "name": "hello", | |
| 2600 | − | "comment_id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4" | |
| 2601 | − | }, | |
| 2602 | − | "request": { | |
| 2603 | − | "body": "Should an empty name fall back to \"world\"? The README says it does." | |
| 2604 | − | }, | |
| 2605 | − | "response": { | |
| 2606 | − | "id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4", | |
| 2607 | − | "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", | |
| 2608 | − | "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 2609 | − | "path": "src/main.rs", | |
| 2610 | − | "line": 12, | |
| 2611 | − | "author": "ana", | |
| 2612 | − | "body": "Should an empty name fall back to \"world\"? The README says it does.", | |
| 2613 | − | "created_at": "2026-10-01T19:02:11.208Z", | |
| 2614 | − | "updated_at": "2026-10-01T19:05:40.117Z" | |
| 2615 | − | }, | |
| 2616 | − | "notes": "Its author only." | |
| 2617 | − | }, | |
| 2618 | − | "delete_commit_comment": { | |
| 2619 | − | "params": { | |
| 2620 | − | "owner": "flagon-io", | |
| 2621 | − | "name": "hello", | |
| 2622 | − | "comment_id": "ccm_01m4a2r7k3d9f1h5j8n2q6t0w4" | |
| 2623 | − | }, | |
| 2624 | − | "notes": "Answers `204` with no body. Its author, or someone with the Maintain role or higher." | |
| 2625 | − | }, | |
| 2626 | 2107 | "close_pull_request": { | |
| 2627 | 2108 | "response": { | |
| 2628 | 2109 | "id": "pr_01m43smh3vexsr5pmp60qwv0vs", | |
| ⋯ | |||
| 9286 | 8767 | "deny_licenses": [] | |
| 9287 | 8768 | } | |
| 9288 | 8769 | }, | |
| 9289 | − | "rerun_dependency_review": { | |
| 9290 | − | "params": { | |
| 9291 | − | "owner": "flagon-io", | |
| 9292 | − | "name": "hello", | |
| 9293 | − | "number": 12 | |
| 9294 | − | }, | |
| 9295 | − | "response": { | |
| 9296 | − | "base": "4b1d7c0e9a2f6e3d8c5b0a7f4e1d2c3b4a5f6e7d", | |
| 9297 | − | "head": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", | |
| 9298 | − | "changes": [ | |
| 9299 | − | { | |
| 9300 | − | "change_type": "added", | |
| 9301 | − | "manifest": "package-lock.json", | |
| 9302 | − | "ecosystem": "npm", | |
| 9303 | − | "name": "lodash", | |
| 9304 | − | "version": "4.17.21", | |
| 9305 | − | "relationship": "direct", | |
| 9306 | − | "development": false, | |
| 9307 | − | "license": "MIT", | |
| 9308 | − | "purl": "pkg:npm/lodash@4.17.21", | |
| 9309 | − | "vulnerabilities": [], | |
| 9310 | − | "denied_license": false, | |
| 9311 | − | "failing": false | |
| 9312 | − | }, | |
| 9313 | − | { | |
| 9314 | − | "change_type": "removed", | |
| 9315 | − | "manifest": "package-lock.json", | |
| 9316 | − | "ecosystem": "npm", | |
| 9317 | − | "name": "lodash", | |
| 9318 | − | "version": "4.17.20", | |
| 9319 | − | "relationship": "direct", | |
| 9320 | − | "development": false, | |
| 9321 | − | "license": "MIT", | |
| 9322 | − | "purl": "pkg:npm/lodash@4.17.20", | |
| 9323 | − | "vulnerabilities": [], | |
| 9324 | − | "denied_license": false, | |
| 9325 | − | "failing": false | |
| 9326 | − | } | |
| 9327 | − | ], | |
| 9328 | − | "passed": true, | |
| 9329 | − | "headline": "2 dependency changes, none vulnerable", | |
| 9330 | − | "fail_on": "high", | |
| 9331 | − | "deny_licenses": [] | |
| 9332 | − | }, | |
| 9333 | − | "notes": "The pull request's one dependency review comment is changed in place; nothing new is posted when the review says the same." | |
| 9334 | − | }, | |
| 9335 | 8770 | "get_security_settings": { | |
| 9336 | 8771 | "params": { | |
| 9337 | 8772 | "owner": "flagon-io", | |
| ⋯ | |||
| 11975 | 11410 | "response": { | |
| 11976 | 11411 | "access_level": "none" | |
| 11977 | 11412 | } | |
| 11978 | − | }, | |
| 11979 | − | "get_actions_permissions": { | |
| 11980 | − | "params": { | |
| 11981 | − | "owner": "ada", | |
| 11982 | − | "name": "hello" | |
| 11983 | − | }, | |
| 11984 | − | "response": { | |
| 11985 | − | "enabled": false, | |
| 11986 | − | "enabled_chosen": false, | |
| 11987 | − | "allowed_actions": "all" | |
| 11988 | − | }, | |
| 11989 | − | "notes": "A fork's workflows are off until someone turns them on: here `ada/hello` is a fork nobody has chosen for yet. See [Forks](/concepts/forks/)." | |
| 11990 | − | }, | |
| 11991 | − | "set_actions_permissions": { | |
| 11992 | − | "params": { | |
| 11993 | − | "owner": "ada", | |
| 11994 | − | "name": "hello" | |
| 11995 | − | }, | |
| 11996 | − | "request": { | |
| 11997 | − | "enabled": true | |
| 11998 | − | }, | |
| 11999 | − | "response": { | |
| 12000 | − | "enabled": true, | |
| 12001 | − | "enabled_chosen": true, | |
| 12002 | − | "allowed_actions": "all" | |
| 12003 | − | }, | |
| 12004 | − | "notes": "Needs the Admin role (`403` otherwise); a workflow job's own token is refused. Turning workflows on starts nothing by itself. See [Turn workflows off](/guides/actions/#turn-workflows-on-or-off)." | |
| 12005 | 11413 | }, | |
| 12006 | 11414 | "set_actions_access": { | |
| 12007 | 11415 | "params": { | |
| 154 | 154 | } | |
| 155 | 155 | match op { | |
| 156 | 156 | Op::GetWorkspace | Op::CreateWorkspace | Op::UpdateWorkspace => through::<g1t_contracts::identity::Workspace>(op, sent), | |
| 157 | − | Op::ListRepos | Op::ListForks => through::<Vec<repos::Repo>>(op, sent), | |
| 158 | − | Op::SyncFork => through::<repos::SyncedFork>(op, sent), | |
| 157 | + | Op::ListRepos => through::<Vec<repos::Repo>>(op, sent), | |
| 159 | 158 | Op::Search => through::<search::SearchResults>(op, sent), | |
| 160 | 159 | Op::GetRepo | |
| 161 | 160 | | Op::CreateRepo | |
| 162 | 161 | | Op::UpdateRepo | |
| 163 | 162 | | Op::TransferRepo | |
| 164 | − | | Op::ForkRepo | |
| 165 | − | | Op::DetachFork | |
| 166 | 163 | | Op::RenameRepo | |
| 167 | 164 | | Op::RenameBranch | |
| 168 | 165 | | Op::ArchiveRepo | |
| ⋯ | |||
| 196 | 193 | | Op::ReopenPullRequest | |
| 197 | 194 | | Op::ConvertPullRequestToDraft | |
| 198 | 195 | | Op::MergePullRequest | |
| 199 | − | | Op::EnablePullRequestAutoMerge | |
| 200 | − | | Op::DisablePullRequestAutoMerge | |
| 201 | − | | Op::DeletePullRequestHeadBranch | |
| 202 | − | | Op::RestorePullRequestHeadBranch | |
| 203 | 196 | | Op::RequestReviewers | |
| 204 | 197 | | Op::RemoveRequestedReviewers => { | |
| 205 | 198 | through::<work::Pull>(op, sent) | |
| 206 | 199 | } | |
| 207 | − | Op::UpdatePullRequestBranch => through::<repos::PullBranchUpdate>(op, sent), | |
| 208 | − | Op::GetPullRequestMergeOptions => through::<work::MergeChoices>(op, sent), | |
| 209 | − | Op::ListRepoCommitComments | Op::ListCommitComments => through::<Vec<work::CommitComment>>(op, sent), | |
| 210 | − | Op::CreateCommitComment | Op::UpdateCommitComment => through::<work::CommitComment>(op, sent), | |
| 211 | 200 | Op::ListWorkflows => through::<Vec<actions::Workflow>>(op, sent), | |
| 212 | 201 | Op::GetWorkflow => through::<actions::WorkflowDetail>(op, sent), | |
| 213 | 202 | Op::ListWorkflowRuns => through::<Vec<actions::WorkflowRun>>(op, sent), | |
| 332 | 332 | route("GET", "/repos/:owner/:name/dependency-graph", Op::Security(SecurityOp::GetDependencyGraph), &[]), | |
| 333 | 333 | route("GET", "/repos/:owner/:name/dependency-graph/sbom", Op::Security(SecurityOp::GetSbom), &[]), | |
| 334 | 334 | route("GET", "/repos/:owner/:name/dependency-graph/compare/:basehead", Op::Security(SecurityOp::CompareDependencies), &[]), | |
| 335 | − | route("POST", "/repos/:owner/:name/pulls/:number/dependency-review/rerun", Op::Security(SecurityOp::RerunDependencyReview), &[]), | |
| 336 | 335 | route("GET", "/repos/:owner/:name/security/settings", Op::Security(SecurityOp::GetSettings), &[]), | |
| 337 | 336 | route("PATCH", "/repos/:owner/:name/security/settings", Op::Security(SecurityOp::UpdateSettings), &[]), | |
| 338 | 337 | route("GET", "/workspaces/:workspace/security/settings", Op::Security(SecurityOp::GetWorkspaceSettings), &[]), | |
| ⋯ | |||
| 365 | 364 | route("GET", "/repos/:owner/:name/zipball/:ref", Op::Archives(ArchiveOp::DownloadZipball), &[]), | |
| 366 | 365 | route("PATCH", "/repos/:owner/:name", Op::UpdateRepo, &[]), | |
| 367 | 366 | route("POST", "/repos/:owner/:name/transfer", Op::TransferRepo, &[]), | |
| 368 | − | route("POST", "/repos/:owner/:name/forks", Op::ForkRepo, &[]), | |
| 369 | − | route("GET", "/repos/:owner/:name/forks", Op::ListForks, &[("limit", "limit")]), | |
| 370 | − | route("POST", "/repos/:owner/:name/merge-upstream", Op::SyncFork, &[]), | |
| 371 | − | route("POST", "/repos/:owner/:name/detach", Op::DetachFork, &[]), | |
| 372 | 367 | route("DELETE", "/repos/:owner/:name", Op::DeleteRepo, &[]), | |
| 373 | 368 | route( | |
| 374 | 369 | "GET", | |
| ⋯ | |||
| 503 | 498 | ), | |
| 504 | 499 | route("GET", "/repos/:owner/:name/actions/permissions/access", Op::Protection(ProtectionOp::GetActionsAccess), &[]), | |
| 505 | 500 | route("PUT", "/repos/:owner/:name/actions/permissions/access", Op::Protection(ProtectionOp::SetActionsAccess), &[]), | |
| 506 | − | route("GET", "/repos/:owner/:name/actions/permissions", Op::Protection(ProtectionOp::GetActionsPermissions), &[]), | |
| 507 | − | route("PUT", "/repos/:owner/:name/actions/permissions", Op::Protection(ProtectionOp::SetActionsPermissions), &[]), | |
| 508 | 501 | route("POST", "/repos/:owner/:name/dispatches", Op::Protection(ProtectionOp::CreateRepositoryDispatch), &[]), | |
| 509 | 502 | route( | |
| 510 | 503 | "GET", | |
| ⋯ | |||
| 1128 | 1121 | Op::MergePullRequest, | |
| 1129 | 1122 | &[], | |
| 1130 | 1123 | ), | |
| 1131 | − | route("GET", "/repos/:owner/:name/pulls/:number/merge-options", Op::GetPullRequestMergeOptions, &[]), | |
| 1132 | − | route("PUT", "/repos/:owner/:name/pulls/:number/update-branch", Op::UpdatePullRequestBranch, &[]), | |
| 1133 | − | route("PUT", "/repos/:owner/:name/pulls/:number/auto-merge", Op::EnablePullRequestAutoMerge, &[]), | |
| 1134 | − | route("DELETE", "/repos/:owner/:name/pulls/:number/auto-merge", Op::DisablePullRequestAutoMerge, &[]), | |
| 1135 | − | route("DELETE", "/repos/:owner/:name/pulls/:number/head-branch", Op::DeletePullRequestHeadBranch, &[]), | |
| 1136 | − | route("POST", "/repos/:owner/:name/pulls/:number/head-branch/restore", Op::RestorePullRequestHeadBranch, &[]), | |
| 1137 | − | // Commit comments: GitHub's addresses. | |
| 1138 | − | route("GET", "/repos/:owner/:name/comments", Op::ListRepoCommitComments, &[("page", "page")]), | |
| 1139 | − | route("PATCH", "/repos/:owner/:name/comments/:comment_id", Op::UpdateCommitComment, &[]), | |
| 1140 | − | route("DELETE", "/repos/:owner/:name/comments/:comment_id", Op::DeleteCommitComment, &[]), | |
| 1141 | − | route("GET", "/repos/:owner/:name/commits/:sha/comments", Op::ListCommitComments, &[]), | |
| 1142 | − | route("POST", "/repos/:owner/:name/commits/:sha/comments", Op::CreateCommitComment, &[]), | |
| 1143 | 1124 | // Artifacts mode's docs, slides, designs and dashboards. Search comes | |
| 1144 | 1125 | // before an artifact by id, which it would otherwise match. | |
| 1145 | 1126 | route("GET", "/workspaces/:workspace/artifacts", Op::Folios(FoliosOp::List), &[("tab", "tab"), ("kind", "kind"), ("space", "space"), ("project", "project"), ("q", "q"), ("state", "state"), ("cursor", "cursor"), ("limit", "limit")]), | |
| ⋯ | |||
| 1167 | 1148 | pub fn no_content(&self) -> bool { | |
| 1168 | 1149 | matches!( | |
| 1169 | 1150 | self.op, | |
| 1170 | − | Op::DeleteComment | Op::DeleteCommitComment | Op::Caches(CachesOp::DeleteCache) | |
| 1151 | + | Op::DeleteComment | Op::Caches(CachesOp::DeleteCache) | |
| 1171 | 1152 | ) | |
| 1172 | 1153 | } | |
| 1173 | 1154 | ||
| ⋯ | |||
| 1526 | 1507 | let (route, input) = resolve("PATCH", "/repos/acme/web/pulls/9", &[], json!({ "base": "release" })).unwrap(); | |
| 1527 | 1508 | assert_eq!(route.op, Op::UpdatePullRequest); | |
| 1528 | 1509 | assert_eq!(input, json!({ "base": "release", "number": 9, "repo": "acme/web" })); | |
| 1529 | − | } | |
| 1530 | − | ||
| 1531 | − | #[test] | |
| 1532 | − | fn merging_settings_and_commit_comments_have_their_addresses() { | |
| 1533 | − | let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op; | |
| 1534 | − | assert_eq!(op("GET", "/repos/acme/web/pulls/9/merge-options"), Op::GetPullRequestMergeOptions); | |
| 1535 | − | assert_eq!(op("PUT", "/repos/acme/web/pulls/9/update-branch"), Op::UpdatePullRequestBranch); | |
| 1536 | − | assert_eq!(op("PUT", "/repos/acme/web/pulls/9/auto-merge"), Op::EnablePullRequestAutoMerge); | |
| 1537 | − | assert_eq!(op("DELETE", "/repos/acme/web/pulls/9/auto-merge"), Op::DisablePullRequestAutoMerge); | |
| 1538 | − | assert_eq!(op("DELETE", "/repos/acme/web/pulls/9/head-branch"), Op::DeletePullRequestHeadBranch); | |
| 1539 | − | assert_eq!(op("POST", "/repos/acme/web/pulls/9/head-branch/restore"), Op::RestorePullRequestHeadBranch); | |
| 1540 | − | let (route, input) = resolve("GET", "/repos/acme/web/comments", &[("page".to_owned(), "2".to_owned())], Value::Null).unwrap(); | |
| 1541 | − | assert_eq!(route.op, Op::ListRepoCommitComments); | |
| 1542 | − | assert_eq!(input, json!({ "page": "2", "repo": "acme/web" })); | |
| 1543 | − | let (route, input) = | |
| 1544 | − | resolve("POST", "/repos/acme/web/commits/9f2c4e1/comments", &[], json!({ "body": "Why?", "path": "a.rs", "line": 3 })).unwrap(); | |
| 1545 | − | assert_eq!(route.op, Op::CreateCommitComment); | |
| 1546 | − | assert_eq!(input, json!({ "body": "Why?", "path": "a.rs", "line": 3, "sha": "9f2c4e1", "repo": "acme/web" })); | |
| 1547 | − | assert_eq!(op("GET", "/repos/acme/web/commits/9f2c4e1/comments"), Op::ListCommitComments); | |
| 1548 | − | // Still a commit's statuses, beside its comments. | |
| 1549 | − | assert_eq!(op("GET", "/repos/acme/web/commits/main/statuses"), Op::Checks(ChecksOp::ListCommitStatuses)); | |
| 1550 | − | let (route, input) = resolve("PATCH", "/repos/acme/web/comments/cc_1", &[], json!({ "body": "Better" })).unwrap(); | |
| 1551 | − | assert_eq!(route.op, Op::UpdateCommitComment); | |
| 1552 | − | assert_eq!(input, json!({ "body": "Better", "comment_id": "cc_1", "repo": "acme/web" })); | |
| 1553 | − | let (route, _) = resolve("DELETE", "/repos/acme/web/comments/cc_1", &[], Value::Null).unwrap(); | |
| 1554 | − | assert!(route.op == Op::DeleteCommitComment && route.no_content()); | |
| 1555 | − | // An issue's comments keep theirs. | |
| 1556 | − | assert_eq!(op("PATCH", "/repos/acme/web/issues/comments/cmt_1"), Op::EditComment); | |
| 1557 | 1510 | } | |
| 1558 | 1511 | ||
| 1559 | 1512 | #[test] | |
| 54 | 54 | GetDependencyGraph, | |
| 55 | 55 | GetSbom, | |
| 56 | 56 | CompareDependencies, | |
| 57 | − | RerunDependencyReview, | |
| 58 | 57 | GetSettings, | |
| 59 | 58 | UpdateSettings, | |
| 60 | 59 | GetWorkspaceSettings, | |
| ⋯ | |||
| 74 | 73 | /// Every one: `Op::ALL` lists each as `Op::Security(…)`, which a test | |
| 75 | 74 | /// checks against this. | |
| 76 | 75 | #[cfg(test)] | |
| 77 | − | pub const ALL: [SecurityOp; 39] = [ | |
| 76 | + | pub const ALL: [SecurityOp; 38] = [ | |
| 78 | 77 | SecurityOp::ListSecretAlerts, | |
| 79 | 78 | SecurityOp::GetSecretAlert, | |
| 80 | 79 | SecurityOp::UpdateSecretAlert, | |
| ⋯ | |||
| 100 | 99 | SecurityOp::GetDependencyGraph, | |
| 101 | 100 | SecurityOp::GetSbom, | |
| 102 | 101 | SecurityOp::CompareDependencies, | |
| 103 | − | SecurityOp::RerunDependencyReview, | |
| 104 | 102 | SecurityOp::GetSettings, | |
| 105 | 103 | SecurityOp::UpdateSettings, | |
| 106 | 104 | SecurityOp::GetWorkspaceSettings, | |
| ⋯ | |||
| 143 | 141 | SecurityOp::GetDependencyGraph => "get_dependency_graph", | |
| 144 | 142 | SecurityOp::GetSbom => "get_sbom", | |
| 145 | 143 | SecurityOp::CompareDependencies => "compare_dependencies", | |
| 146 | − | SecurityOp::RerunDependencyReview => "rerun_dependency_review", | |
| 147 | 144 | SecurityOp::GetSettings => "get_security_settings", | |
| 148 | 145 | SecurityOp::UpdateSettings => "update_security_settings", | |
| 149 | 146 | SecurityOp::GetWorkspaceSettings => "get_workspace_security_settings", | |
| ⋯ | |||
| 188 | 185 | SecurityOp::GetDependencyGraph => "Get the dependency graph", | |
| 189 | 186 | SecurityOp::GetSbom => "Export an SBOM", | |
| 190 | 187 | SecurityOp::CompareDependencies => "Compare dependencies", | |
| 191 | − | SecurityOp::RerunDependencyReview => "Re-run dependency review", | |
| 192 | 188 | SecurityOp::GetSettings => "Get a repository's security settings", | |
| 193 | 189 | SecurityOp::UpdateSettings => "Update a repository's security settings", | |
| 194 | 190 | SecurityOp::GetWorkspaceSettings => "Get a workspace's security settings", | |
| ⋯ | |||
| 232 | 228 | SecurityOp::GetDependencyGraph => "Get the dependency graph: every package the lockfiles on the default branch resolve, per lockfile, with whether it is direct or transitive (where the lockfile says), for development, its license when recorded, its package URL and its open vulnerability alerts.", | |
| 233 | 229 | SecurityOp::GetSbom => "Export the dependency graph as an SPDX 2.3 JSON document, in sbom. Every package is named by its package URL.", | |
| 234 | 230 | SecurityOp::CompareDependencies => "Compare the dependencies at two commits, branches or tags (basehead, as base...head): what was added and removed per lockfile, with the known vulnerabilities of what was added and whether it passes the repository's dependency review policy. Needs the g1t plan on a private repository.", | |
| 235 | − | SecurityOp::RerunDependencyReview => "Run the Dependency review check again on an open pull request's head, with the advisories known now: its status is set again and its one comment on the pull request is changed in place (or added, when it has dependency changes to show and none is there yet). Returns the review. g1t reviews a pull request by itself when it opens and when its head moves, carrying the result over when the head's lockfile changes are the ones reviewed before. Takes the Write role. Needs the g1t plan on a private repository.", | |
| 236 | 231 | SecurityOp::GetSettings => "Get a repository's security settings: when the Code scanning check fails, dependency review and its policy, whether secrets in the history open alerts, whether it takes private vulnerability reports, its workspace's settings, and whether the paid features are on for it.", | |
| 237 | 232 | SecurityOp::UpdateSettings => "Change a repository's security settings: code_scanning_gate (none, errors, critical, high, medium or any), dependency_review, review_fail_on (critical, high, medium, low or none), review_deny_licenses (SPDX ids), review_comment, history_alerts (whether secrets found in the history open alerts; push protection stays on) and private_vulnerability_reporting. Takes the Admin role, or a security manager of the workspace. Require the Code scanning and Dependency review checks in branch protection to gate merges on them.", | |
| 238 | 233 | SecurityOp::GetWorkspaceSettings => "Get a workspace's security settings (delegated bypass, validity checks) and whether it has Security and quality, which comes with the g1t plan.", | |
| ⋯ | |||
| 433 | 428 | &["repo", "id", "state"], | |
| 434 | 429 | ), | |
| 435 | 430 | SecurityOp::GetDependencyGraph | SecurityOp::GetSbom | SecurityOp::GetSettings => (json!({ "repo": repo() }), &["repo"]), | |
| 436 | − | SecurityOp::RerunDependencyReview => ( | |
| 437 | − | json!({ "repo": repo(), "number": { "type": "integer", "description": "The pull request's number." } }), | |
| 438 | − | &["repo", "number"], | |
| 439 | − | ), | |
| 440 | 431 | SecurityOp::CompareDependencies => ( | |
| 441 | 432 | json!({ | |
| 442 | 433 | "repo": repo(), | |
| ⋯ | |||
| 1046 | 1037 | }; | |
| 1047 | 1038 | pass(services, "dependency_review", &DependencyReviewArgs { viewer: viewer.clone(), repo, base, head }).await | |
| 1048 | 1039 | } | |
| 1049 | − | SecurityOp::RerunDependencyReview => { | |
| 1050 | − | let Some(repo) = repo else { return failed(FailureCode::Invalid, &need_repo()) }; | |
| 1051 | − | let Some(number) = whole(input, "number").filter(|number| *number > 0) else { | |
| 1052 | − | return failed(FailureCode::Invalid, "number is the pull request's number."); | |
| 1053 | − | }; | |
| 1054 | − | pass(services, "rerun_dependency_review", &PullScanningArgs { viewer: viewer.clone(), repo, number }).await | |
| 1055 | − | } | |
| 1056 | 1040 | SecurityOp::GetSettings => { | |
| 1057 | 1041 | let Some(repo) = repo else { return failed(FailureCode::Invalid, &need_repo()) }; | |
| 1058 | 1042 | pass(services, "security_settings", &SecuritySettingsArgs { viewer: viewer.clone(), repo }).await | |
| ⋯ | |||
| 1257 | 1241 | } | |
| 1258 | 1242 | assert_eq!(scope_for("get_sbom"), Some(Scope::SecurityRead)); | |
| 1259 | 1243 | assert_eq!(scope_for("upload_sarif"), Some(Scope::SecurityWrite)); | |
| 1260 | − | assert_eq!(scope_for("rerun_dependency_review"), Some(Scope::SecurityWrite)); | |
| 1261 | 1244 | // No run decides about security. | |
| 1262 | 1245 | for name in ["bypass_push_protection", "review_bypass_request", "update_security_settings"] { | |
| 1263 | 1246 | assert!(g1t_contracts::credentials::NEVER.contains(&name), "{name}"); | |
| 70 | 70 | Tool { | |
| 71 | 71 | name: "repository", | |
| 72 | 72 | title: "Repositories", | |
| 73 | − | description: "Repositories: find, read and create them, change their settings and rulesets (what may happen to branches and tags, and what a pull request needs to merge), check their CODEOWNERS file, manage their labels and milestones, see and dismiss their security alerts (secrets and vulnerable dependencies), read what their default branch says (languages, contributors, license), star them, publish releases and comment on their commits. Name one as \"owner/name\". Deleting, transferring and changing visibility need `confirm`.", | |
| 73 | + | description: "Repositories: find, read and create them, change their settings and rulesets (what may happen to branches and tags, and what a pull request needs to merge), check their CODEOWNERS file, manage their labels and milestones, see and dismiss their security alerts (secrets and vulnerable dependencies), read what their default branch says (languages, contributors, license), star them and publish releases. Name one as \"owner/name\". Deleting, transferring and changing visibility need `confirm`.", | |
| 74 | 74 | default_action: None, | |
| 75 | 75 | actions: &[ | |
| 76 | 76 | a("list", Op::ListRepos, "Repositories you can see"), | |
| 77 | 77 | a("get", Op::GetRepo, "One repository"), | |
| 78 | 78 | a("commits", Op::ListCommits, "A branch's commits with their messages (why each was made); with path, the commit that last changed it"), | |
| 79 | − | a("commit_comments", Op::ListCommitComments, "A commit's comments, on it or on lines of its files"), | |
| 80 | − | a("list_commit_comments", Op::ListRepoCommitComments, "All its commit comments, newest first"), | |
| 81 | − | a("comment_on_commit", Op::CreateCommitComment, "Comment on a commit; path and line for one line of a file it changed"), | |
| 82 | − | a("edit_commit_comment", Op::UpdateCommitComment, "Change your commit comment's text"), | |
| 83 | − | a("delete_commit_comment", Op::DeleteCommitComment, "Delete a commit comment: your own, or any with the Maintain role"), | |
| 84 | 79 | a("contents", Op::GetContents, "A file's text, or a directory's entries and README, at a branch, tag or commit"), | |
| 85 | 80 | a("tarball", Op::Archives(ArchiveOp::DownloadTarball), "A 10-minute link to a branch, tag or commit as a .tar.gz"), | |
| 86 | 81 | a("zipball", Op::Archives(ArchiveOp::DownloadZipball), "A 10-minute link to a branch, tag or commit as a .zip"), | |
| 87 | 82 | a("create", Op::CreateRepo, "Create one, empty or copied from a public git URL"), | |
| 88 | − | a("update", Op::UpdateRepo, "Change description, website, topics, default branch, protection, forking"), | |
| 83 | + | a("update", Op::UpdateRepo, "Change description, website, topics, default branch, protection"), | |
| 89 | 84 | a("get_settings", Op::GetRepoSettings, "How pull requests merge, and the default branch's protection as its rules stack"), | |
| 90 | 85 | a("update_settings", Op::UpdateRepoSettings, "Change how pull requests merge and the default branch protection ruleset"), | |
| 91 | 86 | a("check_names", Op::ListCheckNames, "Check names reported lately, to require in a ruleset"), | |
| ⋯ | |||
| 128 | 123 | a("delete_branch", Op::DeleteBranch, "Delete a branch; make it again at its commit to restore it"), | |
| 129 | 124 | a("rename", Op::RenameRepo, "Rename it; old addresses redirect"), | |
| 130 | 125 | a("transfer", Op::TransferRepo, "Move it to another workspace you own"), | |
| 131 | − | a("fork", Op::ForkRepo, "Fork it into a workspace: its code and description, linked to it"), | |
| 132 | − | a("forks", Op::ListForks, "Its forks you can see"), | |
| 133 | − | a("sync_fork", Op::SyncFork, "Bring a fork's branch up to date with its parent"), | |
| 134 | − | a("detach_fork", Op::DetachFork, "Make a fork an ordinary repository, no longer linked to its parent"), | |
| 135 | 126 | a("archive", Op::ArchiveRepo, "Make it read-only"), | |
| 136 | 127 | a("unarchive", Op::UnarchiveRepo, "Make it writable again"), | |
| 137 | 128 | a("set_visibility", Op::SetRepoVisibility, "Make it public or private"), | |
| ⋯ | |||
| 175 | 166 | Tool { | |
| 176 | 167 | name: "pull_request", | |
| 177 | 168 | title: "Pull requests", | |
| 178 | − | description: "Pull requests: start a change for an issue, record your session, mark it ready, ask people and teams to review, review, update its branch, and merge (by merge, squash, rebase or fast_forward) now or with auto-merge. Read `overlaps` and `behind` on `get` before going far, and `code_owners` for whose approval it needs.", | |
| 169 | + | description: "Pull requests: start a change for an issue, record your session, mark it ready, ask people and teams to review, review and merge. Read `overlaps` and `behind` on `get` before going far, and `code_owners` for whose approval it needs.", | |
| 179 | 170 | default_action: None, | |
| 180 | 171 | actions: &[ | |
| 181 | 172 | a("list", Op::ListPullRequests, "Pull requests on a repository, newest first"), | |
| ⋯ | |||
| 194 | 185 | a("review", Op::ReviewPullRequest, "Approve or request changes"), | |
| 195 | 186 | a("close", Op::ClosePullRequest, "Close without merging"), | |
| 196 | 187 | a("reopen", Op::ReopenPullRequest, "Reopen a closed one"), | |
| 197 | − | a("merge", Op::MergePullRequest, "Land it (merge, squash, rebase or fast_forward), or join the merge queue"), | |
| 198 | − | a("merge_options", Op::GetPullRequestMergeOptions, "How it may merge now: methods, default messages, whether it is behind"), | |
| 199 | − | a("update_branch", Op::UpdatePullRequestBranch, "Bring its branch up to date with its base, by merge or rebase"), | |
| 200 | − | a("enable_auto_merge", Op::EnablePullRequestAutoMerge, "Merge it on its own once its checks, reviews and rules allow"), | |
| 201 | − | a("disable_auto_merge", Op::DisablePullRequestAutoMerge, "Turn its auto-merge off"), | |
| 202 | − | a("delete_branch", Op::DeletePullRequestHeadBranch, "Delete a merged or closed one's branch; restorable"), | |
| 203 | − | a("restore_branch", Op::RestorePullRequestHeadBranch, "Make its deleted branch again at its head"), | |
| 188 | + | a("merge", Op::MergePullRequest, "Land it, or join the merge queue"), | |
| 204 | 189 | a("merge_queue", Op::GetMergeQueue, "The repository's merge queue"), | |
| 205 | 190 | ], | |
| 206 | 191 | }, | |
| ⋯ | |||
| 276 | 261 | a("set_approval_policy", Op::Protection(ProtectionOp::SetForkPrApproval), "Set which pull requests' runs wait for approval"), | |
| 277 | 262 | a("get_access", Op::Protection(ProtectionOp::GetActionsAccess), "Which repositories may use this one's actions and workflows"), | |
| 278 | 263 | a("set_access", Op::Protection(ProtectionOp::SetActionsAccess), "Let the workspace's private repositories use them, or not"), | |
| 279 | − | a("get_enabled", Op::Protection(ProtectionOp::GetActionsPermissions), "Whether its workflows run at all; off for a fork until turned on"), | |
| 280 | − | a("set_enabled", Op::Protection(ProtectionOp::SetActionsPermissions), "Turn its workflows on or off"), | |
| 281 | 264 | a("repository_dispatch", Op::Protection(ProtectionOp::CreateRepositoryDispatch), "Start repository_dispatch workflows with an event"), | |
| 282 | 265 | a("get_workspace_permissions", Op::Protection(ProtectionOp::GetWorkspaceWorkflowPermissions), "A workspace's default and maximum token permissions"), | |
| 283 | 266 | a("set_workspace_permissions", Op::Protection(ProtectionOp::SetWorkspaceWorkflowPermissions), "Set them, and whether jobs may open pull requests"), | |
| ⋯ | |||
| 515 | 498 | a("dependency_graph", Op::Security(SecurityOp::GetDependencyGraph), "Every package the lockfiles resolve, direct or transitive"), | |
| 516 | 499 | a("sbom", Op::Security(SecurityOp::GetSbom), "The dependency graph as an SPDX 2.3 document"), | |
| 517 | 500 | a("compare_dependencies", Op::Security(SecurityOp::CompareDependencies), "What changes in dependencies between base...head"), | |
| 518 | − | a("rerun_dependency_review", Op::Security(SecurityOp::RerunDependencyReview), "Run a pull request's Dependency review check again"), | |
| 519 | 501 | a("settings", Op::Security(SecurityOp::GetSettings), "A repository's security settings"), | |
| 520 | 502 | a("update_settings", Op::Security(SecurityOp::UpdateSettings), "Change when checks fail and dependency review's policy"), | |
| 521 | 503 | a("workspace_settings", Op::Security(SecurityOp::GetWorkspaceSettings), "A workspace's delegated bypass and validity checks"), | |
| ⋯ | |||
| 652 | 634 | | Op::DeleteTeam | |
| 653 | 635 | | Op::RemoveTeamRepo | |
| 654 | 636 | | Op::MergePullRequest | |
| 655 | − | | Op::DeleteCommitComment | |
| 656 | 637 | | Op::RemoveRunner | |
| 657 | 638 | | Op::DeleteRunnerGroup | |
| 658 | 639 | | Op::UpdateRunnerSettings | |
| 713 | 713 | checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" | |
| 714 | 714 | dependencies = [ | |
| 715 | 715 | "quote", | |
| 716 | − | "syn 3.0.7", | |
| 716 | + | "syn 2.0.119", | |
| 717 | 717 | ] | |
| 718 | 718 | ||
| 719 | 719 | [[package]] | |
| ⋯ | |||
| 3487 | 3487 | ||
| 3488 | 3488 | [[package]] | |
| 3489 | 3489 | name = "rustls" | |
| 3490 | − | version = "0.23.45" | |
| 3490 | + | version = "0.23.46" | |
| 3491 | 3491 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3492 | − | checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" | |
| 3492 | + | checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" | |
| 3493 | 3493 | dependencies = [ | |
| 3494 | 3494 | "once_cell", | |
| 3495 | 3495 | "ring", | |
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…