diff --git a/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png b/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png new file mode 100644 index 000000000000..c5908794f2a8 Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png differ diff --git a/assets/images/enterprise/3.4/repository/code-scanning-alert.png b/assets/images/enterprise/3.4/repository/code-scanning-alert.png new file mode 100644 index 000000000000..28a2c2fd559f Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-alert.png differ diff --git a/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png b/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png new file mode 100644 index 000000000000..8221e34a5c2c Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png differ diff --git a/assets/images/enterprise/3.4/repository/code-scanning-free-text-search-areas.png b/assets/images/enterprise/3.4/repository/code-scanning-free-text-search-areas.png new file mode 100644 index 000000000000..756f2c5b172d Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-free-text-search-areas.png differ diff --git a/assets/images/enterprise/3.4/repository/code-scanning-pr-alert.png b/assets/images/enterprise/3.4/repository/code-scanning-pr-alert.png new file mode 100644 index 000000000000..39307058cd97 Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-pr-alert.png differ diff --git a/assets/images/enterprise/3.4/repository/code-scanning-show-paths.png b/assets/images/enterprise/3.4/repository/code-scanning-show-paths.png new file mode 100644 index 000000000000..ebfcac79ed7f Binary files /dev/null and b/assets/images/enterprise/3.4/repository/code-scanning-show-paths.png differ diff --git a/assets/images/help/repository/code-scanning-affected-branches.png b/assets/images/help/repository/code-scanning-affected-branches.png new file mode 100644 index 000000000000..73b0bf209bc0 Binary files /dev/null and b/assets/images/help/repository/code-scanning-affected-branches.png differ diff --git a/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png b/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png index c5908794f2a8..a0096d4b3585 100644 Binary files a/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png and b/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png differ diff --git a/assets/images/help/repository/code-scanning-alert.png b/assets/images/help/repository/code-scanning-alert.png index 28a2c2fd559f..a1cedb5369f0 100644 Binary files a/assets/images/help/repository/code-scanning-alert.png and b/assets/images/help/repository/code-scanning-alert.png differ diff --git a/assets/images/help/repository/code-scanning-create-issue-for-alert.png b/assets/images/help/repository/code-scanning-create-issue-for-alert.png index 8221e34a5c2c..277df5df89f4 100644 Binary files a/assets/images/help/repository/code-scanning-create-issue-for-alert.png and b/assets/images/help/repository/code-scanning-create-issue-for-alert.png differ diff --git a/assets/images/help/repository/code-scanning-free-text-search-areas.png b/assets/images/help/repository/code-scanning-free-text-search-areas.png index 756f2c5b172d..20af94eaef38 100644 Binary files a/assets/images/help/repository/code-scanning-free-text-search-areas.png and b/assets/images/help/repository/code-scanning-free-text-search-areas.png differ diff --git a/assets/images/help/repository/code-scanning-pr-alert.png b/assets/images/help/repository/code-scanning-pr-alert.png index 39307058cd97..6c2e2edad07b 100644 Binary files a/assets/images/help/repository/code-scanning-pr-alert.png and b/assets/images/help/repository/code-scanning-pr-alert.png differ diff --git a/assets/images/help/repository/code-scanning-show-paths.png b/assets/images/help/repository/code-scanning-show-paths.png index ebfcac79ed7f..20c908effc49 100644 Binary files a/assets/images/help/repository/code-scanning-show-paths.png and b/assets/images/help/repository/code-scanning-show-paths.png differ diff --git a/assets/images/help/repository/mermaid-file-diagram.png b/assets/images/help/repository/mermaid-file-diagram.png new file mode 100644 index 000000000000..57d8bb7b2574 Binary files /dev/null and b/assets/images/help/repository/mermaid-file-diagram.png differ diff --git a/assets/images/help/writing/fenced-geojson-rendered-map.png b/assets/images/help/writing/fenced-geojson-rendered-map.png new file mode 100644 index 000000000000..84a40eeec13b Binary files /dev/null and b/assets/images/help/writing/fenced-geojson-rendered-map.png differ diff --git a/assets/images/help/writing/fenced-stl-rendered-object.png b/assets/images/help/writing/fenced-stl-rendered-object.png new file mode 100644 index 000000000000..465561c8a4c5 Binary files /dev/null and b/assets/images/help/writing/fenced-stl-rendered-object.png differ diff --git a/assets/images/help/writing/fenced-topojson-rendered-map.png b/assets/images/help/writing/fenced-topojson-rendered-map.png new file mode 100644 index 000000000000..7cc1bafcce4b Binary files /dev/null and b/assets/images/help/writing/fenced-topojson-rendered-map.png differ diff --git a/components/page-header/RestBanner.tsx b/components/page-header/RestBanner.tsx index 96d2fac76bf5..89f916f047ef 100644 --- a/components/page-header/RestBanner.tsx +++ b/components/page-header/RestBanner.tsx @@ -7,6 +7,7 @@ const restRepoDisplayPages = [ 'branches', 'collaborators', 'commits', + 'deploy_keys', 'deployments', 'pages', 'releases', @@ -19,6 +20,7 @@ const restRepoCategoryExceptionsTitles = { branches: 'Branches', collaborators: 'Collaborators', commits: 'Commits', + deploy_keys: 'Deploy Keys', deployments: 'Deployments', pages: 'GitHub Pages', releases: 'Releases', diff --git a/components/rest/RestReferencePage.tsx b/components/rest/RestReferencePage.tsx index 88be120bef13..37a810c8e37a 100644 --- a/components/rest/RestReferencePage.tsx +++ b/components/rest/RestReferencePage.tsx @@ -68,7 +68,8 @@ export const RestReferencePage = ({ if ( hash && (pathname.endsWith('/rest/reference/repos') || - pathname.endsWith('/rest/reference/enterprise-admin')) + pathname.endsWith('/rest/reference/enterprise-admin') || + pathname.endsWith('/rest/reference/deployments')) ) { setLoadClientsideRedirectExceptions(true) } @@ -160,9 +161,6 @@ export const RestReferencePage = ({ {page.introPlainText} )} -
-
-
@@ -185,6 +183,9 @@ export const RestReferencePage = ({ )}
+
+
+
{subcategories.map((subcategory, index) => (
diff --git a/content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications.md b/content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications.md index 286b7b089f5f..066ef4eb9706 100644 --- a/content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications.md +++ b/content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications.md @@ -134,7 +134,7 @@ Email notifications from {% data variables.product.product_location %} contain t | `To` field | This field connects directly to the thread.{% ifversion not ghae %} If you reply to the email, you'll add a new comment to the conversation.{% endif %} | | `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% data variables.notifications.cc_address %}. The possible notification reasons are:
  • `assign`: You were assigned to an issue or pull request.
  • `author`: You created an issue or pull request.
  • `ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.
  • `comment`: You commented on an issue or pull request.
  • `manual`: There was an update to an issue or pull request you manually subscribed to.
  • `mention`: You were mentioned on an issue or pull request.
  • `push`: Someone committed to a pull request you're subscribed to.
  • `review_requested`: You or a team you're a member of was requested to review a pull request.
  • {% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
  • `security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.
  • {% endif %}
  • `state_change`: An issue or pull request you're subscribed to was either closed or opened.
  • `subscribed`: There was an update in a repository you're watching.
  • `team_mention`: A team you belong to was mentioned on an issue or pull request.
  • `your_activity`: You opened, commented on, or closed an issue or pull request.
| | `mailing list` field | This field identifies the name of the repository and its owner. The format of this address is always `..{% data variables.command_line.backticks %}`. |{% ifversion fpt or ghes or ghae-issue-4864 or ghec %} -| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:
  • `low`
  • `moderate`
  • `high`
  • `critical`
For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." |{% endif %} +| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:
  • `low`
  • `moderate`
  • `high`
  • `critical`
For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." |{% endif %} ## Choosing your notification settings diff --git a/content/account-and-profile/managing-subscriptions-and-notifications-on-github/viewing-and-triaging-notifications/managing-notifications-from-your-inbox.md b/content/account-and-profile/managing-subscriptions-and-notifications-on-github/viewing-and-triaging-notifications/managing-notifications-from-your-inbox.md index 0b8710d4601e..321b39c1caed 100644 --- a/content/account-and-profile/managing-subscriptions-and-notifications-on-github/viewing-and-triaging-notifications/managing-notifications-from-your-inbox.md +++ b/content/account-and-profile/managing-subscriptions-and-notifications-on-github/viewing-and-triaging-notifications/managing-notifications-from-your-inbox.md @@ -173,7 +173,7 @@ If you use {% data variables.product.prodname_dependabot %} to keep your depende - `reason:security_alert` to show notifications for {% data variables.product.prodname_dependabot_alerts %} and security update pull requests. - `author:app/dependabot` to show notifications generated by {% data variables.product.prodname_dependabot %}. This includes {% data variables.product.prodname_dependabot_alerts %}, security update pull requests, and version update pull requests. -For more information about {% data variables.product.prodname_dependabot %}, see "[About managing vulnerable dependencies](/github/managing-security-vulnerabilities/about-managing-vulnerable-dependencies)." +For more information about {% data variables.product.prodname_dependabot %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." {% endif %} {% ifversion ghes < 3.3 or ghae-issue-4864 %} @@ -182,7 +182,7 @@ If you use {% data variables.product.prodname_dependabot %} to tell you about vu - `is:repository_vulnerability_alert` - `reason:security_alert` -For more information about {% data variables.product.prodname_dependabot %}, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +For more information about {% data variables.product.prodname_dependabot %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." {% endif %} {% endif %} diff --git a/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account.md b/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account.md index ec1dab67f4d2..eda7a7fcbacf 100644 --- a/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account.md +++ b/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/managing-security-and-analysis-settings-for-your-user-account.md @@ -49,5 +49,5 @@ For an overview of repository-level security, see "[Securing your repository](/c ## Further reading - "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)" -- "[Managing vulnerabilities in your project's dependencies](/github/managing-security-vulnerabilities/managing-vulnerabilities-in-your-projects-dependencies)" +- "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)" - "[Keeping your dependencies updated automatically](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically)" diff --git a/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository.md b/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository.md index fadc98773a40..e9b90a2b1092 100644 --- a/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository.md +++ b/content/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/permission-levels-for-a-user-account-repository.md @@ -45,7 +45,7 @@ The repository owner has full control of the repository. In addition to the acti | Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" | | Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% ifversion fpt or ghes or ghae-issue-4864 or ghec %} | Control access to {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies | "[Managing security and analysis settings for your repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %} -| Dismiss {% data variables.product.prodname_dependabot_alerts %} in the repository | "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" | +| Dismiss {% data variables.product.prodname_dependabot_alerts %} in the repository | "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" | | Manage data use for a private repository | "[Managing data use settings for your private repository](/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository)"|{% endif %} | Define code owners for the repository | "[About code owners](/github/creating-cloning-and-archiving-repositories/about-code-owners)" | | Archive the repository | "[Archiving repositories](/repositories/archiving-a-github-repository/archiving-repositories)" |{% ifversion fpt or ghec %} diff --git a/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md b/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md index ca6d8479e487..f8547c0cb54b 100644 --- a/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md +++ b/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md @@ -290,7 +290,7 @@ GitHub helps you avoid using third-party software that contains known vulnerabil | Dependency Management Tool | Description | |----|----| -| Dependabot Alerts | You can track your repository's dependencies and receive Dependabot alerts when your enterprise detects vulnerable dependencies. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)." | +| Dependabot Alerts | You can track your repository's dependencies and receive Dependabot alerts when your enterprise detects vulnerable dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)." | | Dependency Graph | The dependency graph is a summary of the manifest and lock files stored in a repository. It shows you the ecosystems and packages your codebase depends on (its dependencies) and the repositories and packages that depend on your project (its dependents). For more information, see "[About the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)." |{% ifversion ghes > 3.1 or ghec %} | Dependency Review | If a pull request contains changes to dependencies, you can view a summary of what has changed and whether there are known vulnerabilities in any of the dependencies. For more information, see "[About dependency review](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review)" or "[Reviewing Dependency Changes in a Pull Request](/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)." | {% endif %} {% ifversion ghec or ghes > 3.2 %} | Dependabot Security Updates | Dependabot can fix vulnerable dependencies for you by raising pull requests with security updates. For more information, see "[About Dependabot security updates](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)." | diff --git a/content/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise.md b/content/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise.md index 94693b6bef25..b53ae482103f 100644 --- a/content/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise.md +++ b/content/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise.md @@ -49,7 +49,7 @@ You can also choose to manually sync vulnerability data at any time. For more in When {% data variables.product.product_location %} receives information about a vulnerability, it identifies repositories in {% data variables.product.product_location %} that use the affected version of the dependency and generates {% data variables.product.prodname_dependabot_alerts %}. You can choose whether or not to notify users automatically about new {% data variables.product.prodname_dependabot_alerts %}. -For repositories with {% data variables.product.prodname_dependabot_alerts %} enabled, scanning is triggered on any push to the default branch that contains a manifest file or lock file. Additionally, when a new vulnerability record is added to {% data variables.product.product_location %}, {% data variables.product.product_name %} scans all existing repositories on {% data variables.product.product_location %} and generates alerts for any repository that is vulnerable. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +For repositories with {% data variables.product.prodname_dependabot_alerts %} enabled, scanning is triggered on any push to the default branch that contains a manifest file or lock file. Additionally, when a new vulnerability record is added to {% data variables.product.product_location %}, {% data variables.product.product_name %} scans all existing repositories on {% data variables.product.product_location %} and generates alerts for any repository that is vulnerable. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." {% ifversion ghes > 3.2 %} ### About {% data variables.product.prodname_dependabot_updates %} @@ -67,7 +67,7 @@ After you enable {% data variables.product.prodname_dependabot_alerts %}, you ca With {% data variables.product.prodname_dependabot_updates %}, {% data variables.product.company_short %} automatically creates pull requests to update dependencies in two ways. - **{% data variables.product.prodname_dependabot_version_updates %}**: Users add a {% data variables.product.prodname_dependabot %} configuration file to the repository to enable {% data variables.product.prodname_dependabot %} to create pull requests when a new version of a tracked dependency is released. For more information, see "[About {% data variables.product.prodname_dependabot_version_updates %}](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates)." -- **{% data variables.product.prodname_dependabot_security_updates %}**: Users toggle a repository setting to enable {% data variables.product.prodname_dependabot %} to create pull requests when {% data variables.product.prodname_dotcom %} detects a vulnerability in one of the dependencies of the dependency graph for the repository. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)." +- **{% data variables.product.prodname_dependabot_security_updates %}**: Users toggle a repository setting to enable {% data variables.product.prodname_dependabot %} to create pull requests when {% data variables.product.prodname_dotcom %} detects a vulnerability in one of the dependencies of the dependency graph for the repository. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)." {% endif %} ## Enabling {% data variables.product.prodname_dependabot_alerts %} diff --git a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts.md b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts.md index 3d628cfa43ae..60fc384867e9 100644 --- a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts.md +++ b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts.md @@ -27,7 +27,15 @@ By default, {% data variables.product.prodname_code_scanning %} analyzes your co Each alert highlights a problem with the code and the name of the tool that identified it. You can see the line of code that triggered the alert, as well as properties of the alert, such as the alert severity{% ifversion fpt or ghes > 3.1 or ghae or ghec %}, security severity,{% endif %} and the nature of the problem. Alerts also tell you when the issue was first introduced. For alerts identified by {% data variables.product.prodname_codeql %} analysis, you will also see information on how to fix the problem. +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} +{% data reusables.code-scanning.alert-default-branch %} +{% endif %} + +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/help/repository/code-scanning-alert.png) +{% else %} +![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/3.4/repository/code-scanning-alert.png) +{% endif %} If you set up {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_codeql %}, you can also find data-flow problems in your code. Data-flow analysis finds potential security issues in code, such as: using data insecurely, passing dangerous arguments to functions, and leaking sensitive information. diff --git a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md index d6ae1c809791..c8f214deaeed 100644 --- a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md +++ b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md @@ -46,9 +46,16 @@ By default, the code scanning alerts page is filtered to show alerts for the def {% else %} ![List of alerts from {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/3.1/help/repository/code-scanning-click-alert.png) {% endif %} +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} + {% data reusables.code-scanning.alert-default-branch %} + ![The "Affected branches" section in an alert](/assets/images/help/repository/code-scanning-affected-branches.png){% endif %} 1. Optionally, if the alert highlights a problem with data flow, click **Show paths** to display the path from the data source to the sink where it's used. + {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![The "Show paths" link on an alert](/assets/images/help/repository/code-scanning-show-paths.png) -1. Alerts from {% data variables.product.prodname_codeql %} analysis include a description of the problem. Click **Show more** for guidance on how to fix your code. + {% else %} + ![The "Show paths" link on an alert](/assets/images/enterprise/3.4/repository/code-scanning-show-paths.png) + {% endif %} +2. Alerts from {% data variables.product.prodname_codeql %} analysis include a description of the problem. Click **Show more** for guidance on how to fix your code. ![Details for an alert](/assets/images/help/repository/code-scanning-alert-details.png) For more information, see "[About {% data variables.product.prodname_code_scanning %} alerts](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts)." @@ -80,6 +87,10 @@ The benefit of using keyword filters is that only values with results are shown If you enter multiple filters, the view will show alerts matching _all_ these filters. For example, `is:closed severity:high branch:main` will only display closed high-severity alerts that are present on the `main` branch. The exception is filters relating to refs (`ref`, `branch` and `pr`): `is:open branch:main branch:next` will show you open alerts from both the `main` branch and the `next` branch. +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} +{% data reusables.code-scanning.filter-non-default-branches %} +{% endif %} + {% ifversion fpt or ghes > 3.3 or ghec %} You can prefix the `tag` filter with `-` to exclude results with that tag. For example, `-tag:style` only shows alerts that do not have the `style` tag{% if codeql-ml-queries %} and `-tag:experimental` will omit all experimental alerts. For more information, see "[About {% data variables.product.prodname_code_scanning %} alerts](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-experimental-alerts)."{% else %}.{% endif %} @@ -96,10 +107,12 @@ You can use the "Only alerts in application code" filter or `autofilter:true` ke You can search the list of alerts. This is useful if there is a large number of alerts in your repository, or if you don't know the exact name for an alert for example. {% data variables.product.product_name %} performs the free text search across: - The name of the alert -- The alert description - The alert details (this also includes the information hidden from view by default in the **Show more** collapsible section) - + {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![The alert information used in searches](/assets/images/help/repository/code-scanning-free-text-search-areas.png) + {% else %} + ![The alert information used in searches](/assets/images/enterprise/3.4/repository/code-scanning-free-text-search-areas.png) + {% endif %} | Supported search | Syntax example | Results | | ---- | ---- | ---- | @@ -113,7 +126,7 @@ You can search the list of alerts. This is useful if there is a large number of **Tips:** - The multiple word search is equivalent to an OR search. -- The AND search will return results where the search terms are found _anywhere_, in any order in the alert name, description, or details. +- The AND search will return results where the search terms are found _anywhere_, in any order in the alert name or details. {% endtip %} @@ -143,7 +156,7 @@ If you have write permission for a repository, you can view fixed alerts by view You can use{% ifversion fpt or ghes > 3.1 or ghae or ghec %} the free text search or{% endif %} the filters to display a subset of alerts and then in turn mark all matching alerts as closed. -Alerts may be fixed in one branch but not in another. You can use the "Branch" drop-down menu, on the summary of alerts, to check whether an alert is fixed in a particular branch. +Alerts may be fixed in one branch but not in another. You can use the "Branch" filter, on the summary of alerts, to check whether an alert is fixed in a particular branch. {% ifversion fpt or ghes > 3.1 or ghae or ghec %} ![Filtering alerts by branch](/assets/images/help/repository/code-scanning-branch-filter.png) @@ -151,6 +164,9 @@ Alerts may be fixed in one branch but not in another. You can use the "Branch" d ![Filtering alerts by branch](/assets/images/enterprise/3.1/help/repository/code-scanning-branch-filter.png) {% endif %} +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} +{% data reusables.code-scanning.filter-non-default-branches %} +{% endif %} ## Dismissing or deleting alerts There are two ways of closing an alert. You can fix the problem in the code, or you can dismiss the alert. Alternatively, if you have admin permissions for the repository, you can delete alerts. Deleting alerts is useful in situations where you have set up a {% data variables.product.prodname_code_scanning %} tool and then decided to remove it, or where you have configured {% data variables.product.prodname_codeql %} analysis with a larger set of queries than you want to continue using, and you've then removed some queries from the tool. In both cases, deleting alerts allows you to clean up your {% data variables.product.prodname_code_scanning %} results. You can delete alerts from the summary list within the **Security** tab. diff --git a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists.md b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists.md index 66e2303aa06f..8b327645828d 100644 --- a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists.md +++ b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists.md @@ -39,7 +39,11 @@ You can use more than one issue to track the same {% data variables.product.prod - A "tracked in" section will also show in the corresponding alert page. + {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![Tracked in section on code scanning alert page](/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png) + {% else %} + ![Tracked in section on code scanning alert page](/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png) + {% endif %} - On the tracking issue, {% data variables.product.prodname_dotcom %} displays a security badge icon in the task list and on the hovercard. @@ -65,7 +69,11 @@ The status of the tracked alert won't change if you change the checkbox state of 1. Optionally, to find the alert to track, you can use the free-text search or the drop-down menus to filter and locate the alert. For more information, see "[Managing code scanning alerts for your repository](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#filtering-code-scanning-alerts)." {% endif %} 1. Towards the top of the page, on the right side, click **Create issue**. + {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![Create a tracking issue for the code scanning alert](/assets/images/help/repository/code-scanning-create-issue-for-alert.png) + {% else %} + ![Create a tracking issue for the code scanning alert](/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png) + {% endif %} {% data variables.product.prodname_dotcom %} automatically creates an issue to track the alert and adds the alert as a task list item. {% data variables.product.prodname_dotcom %} prepopulates the issue: - The title contains the name of the {% data variables.product.prodname_code_scanning %} alert. diff --git a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests.md b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests.md index 66ae7d484f3e..29eaaa3ea7f0 100644 --- a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests.md +++ b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests.md @@ -74,10 +74,17 @@ If you have write permission for the repository, some annotations contain links To see more information about an alert, users with write permission can click the **Show more details** link shown in the annotation. This allows you to see all of the context and metadata provided by the tool in an alert view. In the example below, you can see tags showing the severity, type, and relevant common weakness enumerations (CWEs) for the problem. The view also shows which commit introduced the problem. +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} +{% data reusables.code-scanning.alert-default-branch %} +{% endif %} + In the detailed view for an alert, some {% data variables.product.prodname_code_scanning %} tools, like {% data variables.product.prodname_codeql %} analysis, also include a description of the problem and a **Show more** link for guidance on how to fix your code. +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %} ![Alert description and link to show more information](/assets/images/help/repository/code-scanning-pr-alert.png) - +{% else %} +![Alert description and link to show more information](/assets/images/enterprise/3.4/repository/code-scanning-pr-alert.png) +{% endif %} ## Fixing an alert on your pull request Anyone with push access to a pull request can fix a {% data variables.product.prodname_code_scanning %} alert that's identified on that pull request. If you commit changes to the pull request this triggers a new run of the pull request checks. If your changes fix the problem, the alert is closed and the annotation removed. diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies.md b/content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md similarity index 93% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies.md rename to content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md index 52b0aa9c647d..9545862ba4e0 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies.md +++ b/content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md @@ -1,11 +1,13 @@ --- -title: About alerts for vulnerable dependencies +title: About Dependabot alerts intro: '{% data variables.product.product_name %} sends {% data variables.product.prodname_dependabot_alerts %} when we detect vulnerabilities affecting your repository.' redirect_from: - /articles/about-security-alerts-for-vulnerable-dependencies - /github/managing-security-vulnerabilities/about-security-alerts-for-vulnerable-dependencies - /github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies - /code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies versions: fpt: '*' ghes: '*' @@ -81,7 +83,7 @@ For repositories where {% data variables.product.prodname_dependabot_security_up ## Access to {% data variables.product.prodname_dependabot_alerts %} -You can see all of the alerts that affect a particular project{% ifversion fpt or ghec %} on the repository's Security tab or{% endif %} in the repository's dependency graph. For more information, see "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)." +You can see all of the alerts that affect a particular project{% ifversion fpt or ghec %} on the repository's Security tab or{% endif %} in the repository's dependency graph. For more information, see "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)." By default, we notify people with admin permissions in the affected repositories about new {% data variables.product.prodname_dependabot_alerts %}. {% ifversion fpt or ghec %}{% data variables.product.product_name %} never publicly discloses identified vulnerabilities for any repository. You can also make {% data variables.product.prodname_dependabot_alerts %} visible to additional people or teams working repositories that you own or have admin permissions for. For more information, see "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)." {% endif %} @@ -95,5 +97,5 @@ You can also see all the {% data variables.product.prodname_dependabot_alerts %} ## Further reading - "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates)" -- "[Viewing and updating vulnerable dependencies in your repository](/articles/viewing-and-updating-vulnerable-dependencies-in-your-repository)"{% endif %} +- "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/articles/viewing-and-updating-vulnerable-dependencies-in-your-repository)"{% endif %} {% ifversion fpt or ghec %}- "[Privacy on {% data variables.product.prodname_dotcom %}](/get-started/privacy-on-github)"{% endif %} diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/browsing-security-vulnerabilities-in-the-github-advisory-database.md b/content/code-security/dependabot/dependabot-alerts/browsing-security-vulnerabilities-in-the-github-advisory-database.md similarity index 95% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/browsing-security-vulnerabilities-in-the-github-advisory-database.md rename to content/code-security/dependabot/dependabot-alerts/browsing-security-vulnerabilities-in-the-github-advisory-database.md index 635a4f5ccecd..98741cedb4e7 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/browsing-security-vulnerabilities-in-the-github-advisory-database.md +++ b/content/code-security/dependabot/dependabot-alerts/browsing-security-vulnerabilities-in-the-github-advisory-database.md @@ -6,6 +6,7 @@ miniTocMaxHeadingLevel: 3 redirect_from: - /github/managing-security-vulnerabilities/browsing-security-vulnerabilities-in-the-github-advisory-database - /code-security/supply-chain-security/browsing-security-vulnerabilities-in-the-github-advisory-database + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/browsing-security-vulnerabilities-in-the-github-advisory-database versions: fpt: '*' ghec: '*' @@ -35,7 +36,7 @@ The {% data variables.product.prodname_advisory_database %} contains a list of k We carefully review each advisory for validity. Each {% data variables.product.company_short %}-reviewed advisory has a full description, and contains both ecosystem and package information. -If you enable {% data variables.product.prodname_dependabot_alerts %} for your repositories, you are automatically notified when a new {% data variables.product.company_short %}-reviewed advisory affects packages you depend on. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." +If you enable {% data variables.product.prodname_dependabot_alerts %} for your repositories, you are automatically notified when a new {% data variables.product.company_short %}-reviewed advisory affects packages you depend on. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." ### About unreviewed advisories @@ -107,7 +108,7 @@ You can search the database, and use qualifiers to narrow your search. For examp ## Viewing your vulnerable repositories -For any {% data variables.product.company_short %}-reviewed advisory in the {% data variables.product.prodname_advisory_database %}, you can see which of your repositories are affected by that security vulnerability. To see a vulnerable repository, you must have access to {% data variables.product.prodname_dependabot_alerts %} for that repository. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#access-to-dependabot-alerts)." +For any {% data variables.product.company_short %}-reviewed advisory in the {% data variables.product.prodname_advisory_database %}, you can see which of your repositories are affected by that security vulnerability. To see a vulnerable repository, you must have access to {% data variables.product.prodname_dependabot_alerts %} for that repository. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#access-to-dependabot-alerts)." 1. Navigate to https://github.com/advisories. 2. Click an advisory. diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies.md b/content/code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts.md similarity index 91% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies.md rename to content/code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts.md index 5d8407e57ac6..1ca05f1e5032 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies.md +++ b/content/code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts.md @@ -1,10 +1,11 @@ --- -title: Configuring notifications for vulnerable dependencies -shortTitle: Configuring notifications +title: Configuring notifications for Dependabot alerts +shortTitle: Configure notifications intro: 'Optimize how you receive notifications about {% data variables.product.prodname_dependabot_alerts %}.' redirect_from: - /github/managing-security-vulnerabilities/configuring-notifications-for-vulnerable-dependencies - /code-security/supply-chain-security/configuring-notifications-for-vulnerable-dependencies + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies versions: fpt: '*' ghes: '*' @@ -58,7 +59,7 @@ You can configure notification settings for yourself or your organization from t ## How to reduce the noise from notifications for vulnerable dependencies -If you are concerned about receiving too many notifications for {% data variables.product.prodname_dependabot_alerts %}, we recommend you opt into the weekly email digest, or turn off notifications while keeping {% data variables.product.prodname_dependabot_alerts %} enabled. You can still navigate to see your {% data variables.product.prodname_dependabot_alerts %} in your repository's Security tab. For more information, see "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)." +If you are concerned about receiving too many notifications for {% data variables.product.prodname_dependabot_alerts %}, we recommend you opt into the weekly email digest, or turn off notifications while keeping {% data variables.product.prodname_dependabot_alerts %} enabled. You can still navigate to see your {% data variables.product.prodname_dependabot_alerts %} in your repository's Security tab. For more information, see "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)." ## Further reading diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database.md b/content/code-security/dependabot/dependabot-alerts/editing-security-advisories-in-the-github-advisory-database.md similarity index 94% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database.md rename to content/code-security/dependabot/dependabot-alerts/editing-security-advisories-in-the-github-advisory-database.md index 46757161a191..d23fc344160a 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database.md +++ b/content/code-security/dependabot/dependabot-alerts/editing-security-advisories-in-the-github-advisory-database.md @@ -3,6 +3,7 @@ title: Editing security advisories in the GitHub Advisory Database intro: 'You can submit improvements to any advisory published in the {% data variables.product.prodname_advisory_database %}.' redirect_from: - /code-security/security-advisories/editing-security-advisories-in-the-github-advisory-database + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database versions: fpt: '*' ghec: '*' diff --git a/content/code-security/dependabot/dependabot-alerts/index.md b/content/code-security/dependabot/dependabot-alerts/index.md new file mode 100644 index 000000000000..b474ec8f2d3c --- /dev/null +++ b/content/code-security/dependabot/dependabot-alerts/index.md @@ -0,0 +1,24 @@ +--- +title: Identifying vulnerabilities in your project's dependencies with Dependabot alerts +shortTitle: Dependabot alerts +intro: '{% data variables.product.prodname_dependabot %} generates {% data variables.product.prodname_dependabot_alerts %} when known vulnerabilites are detected in dependencies that your project uses.' +allowTitleToDifferFromFilename: true +versions: + fpt: '*' + ghes: '*' + ghae: issue-4864 + ghec: '*' +topics: + - Dependabot + - Alerts + - Vulnerabilities + - Repositories + - Dependencies +children: + - /browsing-security-vulnerabilities-in-the-github-advisory-database + - /editing-security-advisories-in-the-github-advisory-database + - /about-dependabot-alerts + - /viewing-and-updating-dependabot-alerts + - /configuring-notifications-for-dependabot-alerts +--- + diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository.md b/content/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts.md similarity index 94% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository.md rename to content/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts.md index ce51732a370f..02b5b1a80167 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository.md +++ b/content/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts.md @@ -1,12 +1,13 @@ --- -title: Viewing and updating vulnerable dependencies in your repository +title: Viewing and updating Dependabot alerts intro: 'If {% data variables.product.product_name %} discovers vulnerable dependencies in your project, you can view them on the Dependabot alerts tab of your repository. Then, you can update your project to resolve or dismiss the vulnerability.' redirect_from: - /articles/viewing-and-updating-vulnerable-dependencies-in-your-repository - /github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository - /code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository permissions: Repository administrators and organization owners can view and update dependencies. -shortTitle: View vulnerable dependencies +shortTitle: View Dependabot alerts versions: fpt: '*' ghes: '*' @@ -25,7 +26,7 @@ topics: {% data reusables.dependabot.beta-security-and-version-updates %} {% data reusables.dependabot.enterprise-enable-dependabot %} -Your repository's {% data variables.product.prodname_dependabot_alerts %} tab lists all open and closed {% data variables.product.prodname_dependabot_alerts %}{% ifversion fpt or ghec or ghes > 3.2 %} and corresponding {% data variables.product.prodname_dependabot_security_updates %}{% endif %}. You can{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5638 %} filter alerts by package, ecosystem, or manifest. You can also{% endif %} sort the list of alerts, and you can click into specific alerts for more details. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." +Your repository's {% data variables.product.prodname_dependabot_alerts %} tab lists all open and closed {% data variables.product.prodname_dependabot_alerts %}{% ifversion fpt or ghec or ghes > 3.2 %} and corresponding {% data variables.product.prodname_dependabot_security_updates %}{% endif %}. You can{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5638 %} filter alerts by package, ecosystem, or manifest. You can also{% endif %} sort the list of alerts, and you can click into specific alerts for more details. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." {% ifversion fpt or ghec or ghes > 3.2 %} You can enable automatic security updates for any repository that uses {% data variables.product.prodname_dependabot_alerts %} and the dependency graph. For more information, see "[About {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)." @@ -112,7 +113,7 @@ Each {% data variables.product.prodname_dependabot %} alert has a unique numeric ## Further reading -- "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)"{% ifversion fpt or ghec or ghes > 3.2 %} +- "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)"{% ifversion fpt or ghec or ghes > 3.2 %} - "[Configuring {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates)"{% endif %} - "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" - "[Troubleshooting the detection of vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies)"{% ifversion fpt or ghec or ghes > 3.2 %} diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates.md b/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md similarity index 92% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates.md rename to content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md index b283a4b5e09c..278efb2684dc 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates.md +++ b/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md @@ -6,6 +6,7 @@ redirect_from: - /github/managing-security-vulnerabilities/about-github-dependabot-security-updates - /github/managing-security-vulnerabilities/about-dependabot-security-updates - /code-security/supply-chain-security/about-dependabot-security-updates + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates versions: fpt: '*' ghec: '*' @@ -27,7 +28,7 @@ topics: ## About {% data variables.product.prodname_dependabot_security_updates %} -{% data variables.product.prodname_dependabot_security_updates %} make it easier for you to fix vulnerable dependencies in your repository. If you enable this feature, when a {% data variables.product.prodname_dependabot %} alert is raised for a vulnerable dependency in the dependency graph of your repository, {% data variables.product.prodname_dependabot %} automatically tries to fix it. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)" and "[Configuring {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/configuring-dependabot-security-updates)." +{% data variables.product.prodname_dependabot_security_updates %} make it easier for you to fix vulnerable dependencies in your repository. If you enable this feature, when a {% data variables.product.prodname_dependabot %} alert is raised for a vulnerable dependency in the dependency graph of your repository, {% data variables.product.prodname_dependabot %} automatically tries to fix it. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)" and "[Configuring {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/configuring-dependabot-security-updates)." {% data variables.product.prodname_dotcom %} may send {% data variables.product.prodname_dependabot_alerts %} to repositories affected by a vulnerability disclosed by a recently published {% data variables.product.prodname_dotcom %} security advisory. {% data reusables.security-advisory.link-browsing-advisory-db %} diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates.md b/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md similarity index 95% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates.md rename to content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md index 4b5d03893f05..6cc5ca642cbc 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates.md +++ b/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md @@ -9,6 +9,7 @@ redirect_from: - /github/managing-security-vulnerabilities/configuring-github-dependabot-security-updates - /github/managing-security-vulnerabilities/configuring-dependabot-security-updates - /code-security/supply-chain-security/configuring-dependabot-security-updates + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates versions: fpt: '*' ghec: '*' @@ -74,6 +75,6 @@ You can also enable or disable {% data variables.product.prodname_dependabot_sec ## Further reading -- "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)"{% ifversion fpt or ghec %} +- "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)"{% ifversion fpt or ghec %} - "[Managing data use settings for your private repository](/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository)"{% endif %} - "[Supported package ecosystems](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems)" diff --git a/content/code-security/dependabot/dependabot-security-updates/index.md b/content/code-security/dependabot/dependabot-security-updates/index.md new file mode 100644 index 000000000000..d5d9e2ae0cc8 --- /dev/null +++ b/content/code-security/dependabot/dependabot-security-updates/index.md @@ -0,0 +1,20 @@ +--- +title: Automatically updating dependencies with known vulnerabilities with Dependabot security updates +intro: '{% data variables.product.prodname_dependabot %} can help you fix vulnerable dependencies by automatically raising pull requests to update dependencies to secure versions.' +allowTitleToDifferFromFilename: true +versions: + fpt: '*' + ghec: '*' + ghes: '>3.2' +topics: + - Repositories + - Dependabot + - Security updates + - Dependencies + - Pull requests +shortTitle: Dependabot security updates +children: + - /about-dependabot-security-updates + - /configuring-dependabot-security-updates +--- + diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates.md b/content/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates.md similarity index 90% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates.md rename to content/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates.md index 0a2e98654aee..c2cc636e9483 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates.md @@ -8,6 +8,7 @@ redirect_from: - /github/administering-a-repository/about-dependabot-version-updates - /code-security/supply-chain-security/about-dependabot-version-updates - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/upgrading-from-dependabotcom-to-github-native-dependabot + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates versions: fpt: '*' ghec: '*' @@ -31,7 +32,7 @@ shortTitle: Dependabot version updates You enable {% data variables.product.prodname_dependabot_version_updates %} by checking a configuration file into your repository. The configuration file specifies the location of the manifest, or of other package definition files, stored in your repository. {% data variables.product.prodname_dependabot %} uses this information to check for outdated packages and applications. {% data variables.product.prodname_dependabot %} determines if there is a new version of a dependency by looking at the semantic versioning ([semver](https://semver.org/)) of the dependency to decide whether it should update to that version. For certain package managers, {% data variables.product.prodname_dependabot_version_updates %} also supports vendoring. Vendored (or cached) dependencies are dependencies that are checked in to a specific directory in a repository rather than referenced in a manifest. Vendored dependencies are available at build time even if package servers are unavailable. {% data variables.product.prodname_dependabot_version_updates %} can be configured to check vendored dependencies for new versions and update them if necessary. -When {% data variables.product.prodname_dependabot %} identifies an outdated dependency, it raises a pull request to update the manifest to the latest version of the dependency. For vendored dependencies, {% data variables.product.prodname_dependabot %} raises a pull request to replace the outdated dependency with the new version directly. You check that your tests pass, review the changelog and release notes included in the pull request summary, and then merge it. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +When {% data variables.product.prodname_dependabot %} identifies an outdated dependency, it raises a pull request to update the manifest to the latest version of the dependency. For vendored dependencies, {% data variables.product.prodname_dependabot %} raises a pull request to replace the outdated dependency with the new version directly. You check that your tests pass, review the changelog and release notes included in the pull request summary, and then merge it. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." If you enable _security updates_, {% data variables.product.prodname_dependabot %} also raises pull requests to update vulnerable dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates)." @@ -50,7 +51,7 @@ If you've enabled security updates, you'll sometimes see extra pull requests for ## Supported repositories and ecosystems -You can configure version updates for repositories that contain a dependency manifest or lock file for one of the supported package managers. For some package managers, you can also configure vendoring for dependencies. For more information, see "[Configuration options for dependency updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#vendor)." +You can configure version updates for repositories that contain a dependency manifest or lock file for one of the supported package managers. For some package managers, you can also configure vendoring for dependencies. For more information, see "[Configuration options for the dependabot.yml file](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#vendor)." {% note %} {% data reusables.dependabot.private-dependencies-note %} diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates.md b/content/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file.md similarity index 98% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates.md rename to content/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file.md index 4e18304d1ae4..fa69a7d01bf3 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file.md @@ -1,10 +1,12 @@ --- -title: Configuration options for dependency updates +title: Configuration options for the dependabot.yml file intro: 'Detailed information for all the options you can use to customize how {% data variables.product.prodname_dependabot %} maintains your repositories.' permissions: 'People with write permissions to a repository can configure {% data variables.product.prodname_dependabot %} for the repository.' +allowTitleToDifferFromFilename: true redirect_from: - /github/administering-a-repository/configuration-options-for-dependency-updates - /code-security/supply-chain-security/configuration-options-for-dependency-updates + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates miniTocMaxHeadingLevel: 3 versions: fpt: '*' @@ -17,7 +19,7 @@ topics: - Repositories - Dependencies - Pull requests -shortTitle: Configuration options +shortTitle: Configure dependabot.yml --- {% data reusables.dependabot.beta-security-and-version-updates %} @@ -27,7 +29,7 @@ shortTitle: Configuration options The {% data variables.product.prodname_dependabot %} configuration file, *dependabot.yml*, uses YAML syntax. If you're new to YAML and want to learn more, see "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)." -You must store this file in the `.github` directory of your repository. When you add or update the *dependabot.yml* file, this triggers an immediate check for version updates. For more information and an example, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates#enabling-dependabot-version-updates)." +You must store this file in the `.github` directory of your repository. When you add or update the *dependabot.yml* file, this triggers an immediate check for version updates. For more information and an example, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates#enabling-dependabot-version-updates)." Any options that also affect security updates are used the next time a security alert triggers a pull request for a security update. For more information, see "[Configuring {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates)." diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates.md b/content/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates.md similarity index 93% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates.md rename to content/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates.md index ab9c946fed01..383009127e7e 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates.md @@ -1,11 +1,12 @@ --- -title: Enabling and disabling Dependabot version updates +title: Configuring Dependabot version updates intro: 'You can configure your repository so that {% data variables.product.prodname_dependabot %} automatically updates the packages you use.' permissions: 'People with write permissions to a repository can enable or disable {% data variables.product.prodname_dependabot_version_updates %} for the repository.' redirect_from: - /github/administering-a-repository/enabling-and-disabling-version-updates - /code-security/supply-chain-security/enabling-and-disabling-version-updates - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-version-updates + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates versions: fpt: '*' ghec: '*' @@ -17,7 +18,7 @@ topics: - Repositories - Dependencies - Pull requests -shortTitle: Enable and disable updates +shortTitle: Configure version updates --- {% data reusables.dependabot.beta-security-and-version-updates %} @@ -33,7 +34,7 @@ You enable {% data variables.product.prodname_dependabot_version_updates %} by c ## Enabling {% data variables.product.prodname_dependabot_version_updates %} -{% data reusables.dependabot.create-dependabot-yml %} For information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates)." +{% data reusables.dependabot.create-dependabot-yml %} For information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates)." 1. Add a `version`. 1. Optionally, if you have dependencies in a private registry, add a `registries` section containing authentication details. 1. Add an `updates` section, with an entry for each package manager you want {% data variables.product.prodname_dependabot %} to monitor. @@ -137,4 +138,4 @@ updates: update-types: ["version-update:semver-patch"] ``` -For more information about checking for existing ignore preferences, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#ignore)." +For more information about checking for existing ignore preferences, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#ignore)." diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates.md b/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md similarity index 92% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates.md rename to content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md index 217257ceb262..7ae4112ea1eb 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md @@ -5,6 +5,7 @@ permissions: 'People with write permissions to a repository can configure {% dat redirect_from: - /github/administering-a-repository/customizing-dependency-updates - /code-security/supply-chain-security/customizing-dependency-updates + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates versions: fpt: '*' ghec: '*' @@ -34,7 +35,7 @@ After you've enabled version updates, you can customize how {% data variables.pr - Change the maximum number of open pull requests for version updates from the default of 5: `open-pull-requests-limit` - Open pull requests for version updates to target a specific branch, instead of the default branch: `target-branch` -For more information about the configuration options, see "[Configuration options for dependency updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)." +For more information about the configuration options, see "[Configuration options for the dependabot.yml file](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)." When you update the *dependabot.yml* file in your repository, {% data variables.product.prodname_dependabot %} runs an immediate check with the new configuration. Within minutes you will see an updated list of dependencies on the **{% data variables.product.prodname_dependabot %}** tab, this may take longer if the repository has many dependencies. You may also see new pull requests for version updates. For more information, see "[Listing dependencies configured for version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates)." @@ -140,4 +141,4 @@ updates: ## More examples -For more examples, see "[Configuration options for dependency updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)." +For more examples, see "[Configuration options for the dependabot.yml file](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)." diff --git a/content/code-security/dependabot/dependabot-version-updates/index.md b/content/code-security/dependabot/dependabot-version-updates/index.md new file mode 100644 index 000000000000..0a8b2903c78c --- /dev/null +++ b/content/code-security/dependabot/dependabot-version-updates/index.md @@ -0,0 +1,26 @@ +--- +title: Keeping your dependencies updated automatically with Dependabot version updates +intro: 'You can use {% data variables.product.prodname_dependabot %} to automatically keep the dependencies and packages used in your repository updated to the latest version, even when they don’t have any known vulnerabilities.' +allowTitleToDifferFromFilename: true +redirect_from: + - /github/administering-a-repository/keeping-your-dependencies-updated-automatically + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically +versions: + fpt: '*' + ghec: '*' + ghes: '>3.2' +topics: + - Repositories + - Dependabot + - Version updates + - Dependencies + - Pull requests +children: + - /about-dependabot-version-updates + - /configuring-dependabot-version-updates + - /listing-dependencies-configured-for-version-updates + - /customizing-dependency-updates + - /configuration-options-for-the-dependabot.yml-file +shortTitle: Dependabot version updates +--- + diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates.md b/content/code-security/dependabot/dependabot-version-updates/listing-dependencies-configured-for-version-updates.md similarity index 84% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates.md rename to content/code-security/dependabot/dependabot-version-updates/listing-dependencies-configured-for-version-updates.md index 4a0585c911fe..697e9d131e90 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/listing-dependencies-configured-for-version-updates.md @@ -4,6 +4,7 @@ intro: 'You can view the dependencies that {% data variables.product.prodname_de redirect_from: - /github/administering-a-repository/listing-dependencies-configured-for-version-updates - /code-security/supply-chain-security/listing-dependencies-configured-for-version-updates + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates versions: fpt: '*' ghec: '*' @@ -22,7 +23,7 @@ shortTitle: List configured dependencies ## Viewing dependencies monitored by {% data variables.product.prodname_dependabot %} -After you've enabled version updates, you can confirm that your configuration is correct using the **{% data variables.product.prodname_dependabot %}** tab in the dependency graph for the repository. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +After you've enabled version updates, you can confirm that your configuration is correct using the **{% data variables.product.prodname_dependabot %}** tab in the dependency graph for the repository. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.accessing-repository-graphs %} diff --git a/content/code-security/dependabot/index.md b/content/code-security/dependabot/index.md new file mode 100644 index 000000000000..cb1f4984f916 --- /dev/null +++ b/content/code-security/dependabot/index.md @@ -0,0 +1,23 @@ +--- +title: Keeping your supply chain secure with Dependabot +shortTitle: Dependabot +intro: 'Monitor vulnerabilities in dependencies used in your project{% ifversion fpt or ghec or ghes > 3.2 %} and keep your dependencies up-to-date{% endif %} with {% data variables.product.prodname_dependabot %}.' +allowTitleToDifferFromFilename: true +versions: + fpt: '*' + ghes: '*' + ghae: issue-4864 + ghec: '*' +topics: + - Dependabot + - Alerts + - Vulnerabilities + - Repositories + - Dependencies +children: + - /dependabot-alerts + - /dependabot-security-updates + - /dependabot-version-updates + - /working-with-dependabot +--- + diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions.md b/content/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions.md similarity index 99% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions.md rename to content/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions.md index 9b97e577a9dc..d819a42fada1 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions.md +++ b/content/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions.md @@ -17,6 +17,8 @@ topics: - Dependencies - Pull requests shortTitle: Use Dependabot with Actions +redirect_from: + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions --- {% data reusables.dependabot.beta-security-and-version-updates %} diff --git a/content/code-security/dependabot/working-with-dependabot/index.md b/content/code-security/dependabot/working-with-dependabot/index.md new file mode 100644 index 000000000000..2ff0dbc0daf9 --- /dev/null +++ b/content/code-security/dependabot/working-with-dependabot/index.md @@ -0,0 +1,24 @@ +--- +title: Working with Dependabot +shortTitle: Work with Dependabot +intro: 'Guidance and recommendations for working with {% data variables.product.prodname_dependabot %}, such as managing pull requests raised by {% data variables.product.prodname_dependabot %}, using {% data variables.product.prodname_actions %} with {% data variables.product.prodname_dependabot %}, and troubleshooting {% data variables.product.prodname_dependabot %} errors.' +versions: + fpt: '*' + ghec: '*' + ghes: '>3.2' +topics: + - Repositories + - Dependabot + - Version updates + - Security updates + - Dependencies + - Pull requests +children: + - /managing-pull-requests-for-dependency-updates + - /automating-dependabot-with-github-actions + - /keeping-your-actions-up-to-date-with-dependabot + - /managing-encrypted-secrets-for-dependabot + - /troubleshooting-the-detection-of-vulnerable-dependencies + - /troubleshooting-dependabot-errors +--- + diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot.md b/content/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot.md similarity index 88% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot.md rename to content/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot.md index 7261cc6b3be2..e373bef51aed 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot.md +++ b/content/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot.md @@ -5,6 +5,7 @@ redirect_from: - /github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot - /github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot - /code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot versions: fpt: '*' ghec: '*' @@ -36,7 +37,7 @@ Actions are often updated with bug fixes and new features to make automated proc 1. Set a `schedule.interval` to specify how often to check for new versions. {% data reusables.dependabot.check-in-dependabot-yml %} If you have edited an existing file, save your changes. -You can also enable {% data variables.product.prodname_dependabot_version_updates %} on forks. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates#enabling-version-updates-on-forks)." +You can also enable {% data variables.product.prodname_dependabot_version_updates %} on forks. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates#enabling-version-updates-on-forks)." ### Example *dependabot.yml* file for {% data variables.product.prodname_actions %} @@ -57,7 +58,7 @@ updates: ## Configuring {% data variables.product.prodname_dependabot_version_updates %} for actions -When enabling {% data variables.product.prodname_dependabot_version_updates %} for actions, you must specify values for `package-ecosystem`, `directory`, and `schedule.interval`. There are many more optional properties that you can set to further customize your version updates. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates)." +When enabling {% data variables.product.prodname_dependabot_version_updates %} for actions, you must specify values for `package-ecosystem`, `directory`, and `schedule.interval`. There are many more optional properties that you can set to further customize your version updates. For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates)." ## Further reading diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-encrypted-secrets-for-dependabot.md b/content/code-security/dependabot/working-with-dependabot/managing-encrypted-secrets-for-dependabot.md similarity index 93% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-encrypted-secrets-for-dependabot.md rename to content/code-security/dependabot/working-with-dependabot/managing-encrypted-secrets-for-dependabot.md index 2227c4590041..c6f149b16ad7 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-encrypted-secrets-for-dependabot.md +++ b/content/code-security/dependabot/working-with-dependabot/managing-encrypted-secrets-for-dependabot.md @@ -4,6 +4,7 @@ intro: 'You can store sensitive information, like passwords and access tokens, a redirect_from: - /github/administering-a-repository/managing-encrypted-secrets-for-dependabot - /code-security/supply-chain-security/managing-encrypted-secrets-for-dependabot + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-encrypted-secrets-for-dependabot versions: fpt: '*' ghec: '*' @@ -33,7 +34,7 @@ password: ${{secrets.MY_ARTIFACTORY_PASSWORD}} ``` {% endraw %} -For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." +For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." ### Naming your secrets diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates.md b/content/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates.md similarity index 93% rename from content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates.md rename to content/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates.md index 99176596b7a1..e3fefa8389df 100644 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates.md +++ b/content/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates.md @@ -4,6 +4,7 @@ intro: 'You manage pull requests raised by {% data variables.product.prodname_de redirect_from: - /github/administering-a-repository/managing-pull-requests-for-dependency-updates - /code-security/supply-chain-security/managing-pull-requests-for-dependency-updates + - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates versions: fpt: '*' ghec: '*' @@ -41,7 +42,7 @@ If you have many dependencies to manage, you may want to customize the configura ## Changing the rebase strategy for {% data variables.product.prodname_dependabot %} pull requests -By default, {% data variables.product.prodname_dependabot %} automatically rebases pull requests to resolve any conflicts. If you'd prefer to handle merge conflicts manually, you can disable this using the `rebase-strategy` option. For details, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#rebase-strategy)." +By default, {% data variables.product.prodname_dependabot %} automatically rebases pull requests to resolve any conflicts. If you'd prefer to handle merge conflicts manually, you can disable this using the `rebase-strategy` option. For details, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#rebase-strategy)." ## Managing {% data variables.product.prodname_dependabot %} pull requests with comment commands @@ -62,4 +63,4 @@ You can use any of the following commands on a {% data variables.product.prodnam {% data variables.product.prodname_dependabot %} will react with a "thumbs up" emoji to acknowledge the command, and may respond with a comment on the pull request. While {% data variables.product.prodname_dependabot %} usually responds quickly, some commands may take several minutes to complete if {% data variables.product.prodname_dependabot %} is busy processing other updates or commands. -If you run any of the commands for ignoring dependencies or versions, {% data variables.product.prodname_dependabot %} stores the preferences for the repository centrally. While this is a quick solution, for repositories with more than one contributor it is better to explicitly define the dependencies and versions to ignore in the configuration file. This makes it easy for all contributors to see why a particular dependency isn't being updated automatically. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#ignore)." +If you run any of the commands for ignoring dependencies or versions, {% data variables.product.prodname_dependabot %} stores the preferences for the repository centrally. While this is a quick solution, for repositories with more than one contributor it is better to explicitly define the dependencies and versions to ignore in the configuration file. This makes it easy for all contributors to see why a particular dependency isn't being updated automatically. For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#ignore)." diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors.md b/content/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors.md similarity index 90% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors.md rename to content/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors.md index f0e5dc57aa97..d79a0241dfe7 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors.md +++ b/content/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors.md @@ -6,6 +6,7 @@ redirect_from: - /github/managing-security-vulnerabilities/troubleshooting-github-dependabot-errors - /github/managing-security-vulnerabilities/troubleshooting-dependabot-errors - /code-security/supply-chain-security/troubleshooting-dependabot-errors + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors versions: fpt: '*' ghec: '*' @@ -76,7 +77,7 @@ Pull requests for security updates act to upgrade a vulnerable dependency to the Every application that has dependencies has a dependency graph, that is, a directed acyclic graph of every package version that the application directly or indirectly depends on. Every time a dependency is updated, this graph must resolve otherwise the application won't build. When an ecosystem has a deep and complex dependency graph, for example, npm and RubyGems, it is often impossible to upgrade a single dependency without upgrading the whole ecosystem. -The best way to avoid this problem is to stay up to date with the most recently released versions, for example, by enabling version updates. This increases the likelihood that a vulnerability in one dependency can be resolved by a simple upgrade that doesn't break the dependency graph. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +The best way to avoid this problem is to stay up to date with the most recently released versions, for example, by enabling version updates. This increases the likelihood that a vulnerability in one dependency can be resolved by a simple upgrade that doesn't break the dependency graph. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." ### {% data variables.product.prodname_dependabot %} cannot update to the required version as there is already an open pull request for the latest version @@ -90,13 +91,13 @@ There are two options: you can review the open pull request and merge it as soon This error is difficult to address. If a version update times out, you could specify the most important dependencies to update using the `allow` parameter or, alternatively, use the `ignore` parameter to exclude some dependencies from updates. Updating your configuration might allow {% data variables.product.prodname_dependabot %} to review the version update and generate the pull request in the time available. -If a security update times out, you can reduce the chances of this happening by keeping the dependencies updated, for example, by enabling version updates. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +If a security update times out, you can reduce the chances of this happening by keeping the dependencies updated, for example, by enabling version updates. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." ### {% data variables.product.prodname_dependabot %} cannot open any more pull requests There's a limit on the number of open pull requests {% data variables.product.prodname_dependabot %} will generate. When this limit is reached, no new pull requests are opened and this error is reported. The best way to resolve this error is to review and merge some of the open pull requests. -There are separate limits for security and version update pull requests, so that open version update pull requests cannot block the creation of a security update pull request. The limit for security update pull requests is 10. By default, the limit for version updates is 5 but you can change this using the `open-pull-requests-limit` parameter in the configuration file. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#open-pull-requests-limit)." +There are separate limits for security and version update pull requests, so that open version update pull requests cannot block the creation of a security update pull request. The limit for security update pull requests is 10. By default, the limit for version updates is 5 but you can change this using the `open-pull-requests-limit` parameter in the configuration file. For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#open-pull-requests-limit)." The best way to resolve this error is to merge or close some of the existing pull requests and trigger a new pull request manually. For more information, see "[Triggering a {% data variables.product.prodname_dependabot %} pull request manually](#triggering-a-dependabot-pull-request-manually)." @@ -125,3 +126,8 @@ If you unblock {% data variables.product.prodname_dependabot %}, you can manuall - **Security updates**—display the {% data variables.product.prodname_dependabot %} alert that shows the error you have fixed and click **Create {% data variables.product.prodname_dependabot %} security update**. - **Version updates**—on the **Insights** tab for the repository click **Dependency graph**, and then click the **Dependabot** tab. Click **Last checked *TIME* ago** to see the log file that {% data variables.product.prodname_dependabot %} generated during the last check for version updates. Click **Check for updates**. + +## Further reading + +- "[Troubleshooting the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph)" +- "[Troubleshooting the detection of vulnerable dependencies](/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies)" diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies.md b/content/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies.md similarity index 70% rename from content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies.md rename to content/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies.md index 4a967cf2fb29..722d2e48bde4 100644 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies.md +++ b/content/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies.md @@ -1,10 +1,11 @@ --- title: Troubleshooting the detection of vulnerable dependencies intro: 'If the dependency information reported by {% data variables.product.product_name %} is not what you expected, there are a number of points to consider, and various things you can check.' -shortTitle: Troubleshoot detection +shortTitle: Troubleshoot vulnerability detection redirect_from: - /github/managing-security-vulnerabilities/troubleshooting-the-detection-of-vulnerable-dependencies - /code-security/supply-chain-security/troubleshooting-the-detection-of-vulnerable-dependencies + - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies versions: fpt: '*' ghes: '*' @@ -19,72 +20,39 @@ topics: - Security updates - Dependencies - Vulnerabilities - - Dependency graph - - Alerts - CVEs - Repositories --- {% data reusables.dependabot.beta-security-and-version-updates %} - -The results of dependency detection reported by {% data variables.product.product_name %} may be different from the results returned by other tools. There are good reasons for this and it's helpful to understand how {% data variables.product.prodname_dotcom %} determines dependencies for your project. +{% data reusables.dependabot.result-discrepancy %} ## Why do some dependencies seem to be missing? {% data variables.product.prodname_dotcom %} generates and displays dependency data differently than other tools. Consequently, if you've been using another tool to identify dependencies you will almost certainly see different results. Consider the following: * {% data variables.product.prodname_advisory_database %} is one of the data sources that {% data variables.product.prodname_dotcom %} uses to identify vulnerable dependencies. It's a free, curated database of vulnerability information for common package ecosystems on {% data variables.product.prodname_dotcom %}. It includes both data reported directly to {% data variables.product.prodname_dotcom %} from {% data variables.product.prodname_security_advisories %}, as well as official feeds and community sources. This data is reviewed and curated by {% data variables.product.prodname_dotcom %} to ensure that false or unactionable information is not shared with the development community. {% data reusables.security-advisory.link-browsing-advisory-db %} -* The dependency graph parses all known package manifest files in a user’s repository. For example, for npm it will parse the _package-lock.json_ file. It constructs a graph of all of the repository’s dependencies and public dependents. This happens when you enable the dependency graph and when anyone pushes to the default branch, and it includes commits that makes changes to a supported manifest format. For more information, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)." -* {% data variables.product.prodname_dependabot %} scans any push, to the default branch, that contains a manifest file. When a new vulnerability record is added, it scans all existing repositories and generates an alert for each vulnerable repository. {% data variables.product.prodname_dependabot_alerts %} are aggregated at the repository level, rather than creating one alert per vulnerability. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." +* The dependency graph parses all known package manifest files in a user’s repository. For example, for npm it will parse the _package-lock.json_ file. It constructs a graph of all of the repository’s dependencies and public dependents. This happens when you enable the dependency graph and when anyone pushes to the default branch, and it includes commits that makes changes to a supported manifest format. For more information, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)" and "[Troubleshooting the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph)." +* {% data variables.product.prodname_dependabot %} scans any push, to the default branch, that contains a manifest file. When a new vulnerability record is added, it scans all existing repositories and generates an alert for each vulnerable repository. {% data variables.product.prodname_dependabot_alerts %} are aggregated at the repository level, rather than creating one alert per vulnerability. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." * {% ifversion fpt or ghec or ghes > 3.2 %}{% data variables.product.prodname_dependabot_security_updates %} are triggered when you receive an alert about a vulnerable dependency in your repository. Where possible, {% data variables.product.prodname_dependabot %} creates a pull request in your repository to upgrade the vulnerable dependency to the minimum possible secure version needed to avoid the vulnerability. For more information, see "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates)" and "[Troubleshooting {% data variables.product.prodname_dependabot %} errors](/github/managing-security-vulnerabilities/troubleshooting-dependabot-errors)." - {% endif %}{% data variables.product.prodname_dependabot %} doesn't scan repositories for vulnerable dependencies on a schedule, but rather when something changes. For example, a scan is triggered when a new dependency is added ({% data variables.product.prodname_dotcom %} checks for this on every push), or when a new vulnerability is added to the advisory database{% ifversion ghes or ghae-issue-4864 %} and synchronized to {% data variables.product.product_location %}{% endif %}. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#detection-of-vulnerable-dependencies)." - -## Why don't I get vulnerability alerts for some ecosystems? + {% endif %}{% data variables.product.prodname_dependabot %} doesn't scan repositories for vulnerable dependencies on a schedule, but rather when something changes. For example, a scan is triggered when a new dependency is added ({% data variables.product.prodname_dotcom %} checks for this on every push), or when a new vulnerability is added to the advisory database{% ifversion ghes or ghae-issue-4864 %} and synchronized to {% data variables.product.product_location %}{% endif %}. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#detection-of-vulnerable-dependencies)." -{% data variables.product.prodname_dotcom %} limits its support for vulnerability alerts to a set of ecosystems where we can provide high-quality, actionable data. Curated vulnerabilities in the {% data variables.product.prodname_advisory_database %}, the dependency graph, {% ifversion fpt or ghec %}{% data variables.product.prodname_dependabot %} security updates, {% endif %}and {% data variables.product.prodname_dependabot_alerts %} are provided for several ecosystems, including Java’s Maven, JavaScript’s npm and Yarn, .NET’s NuGet, Python’s pip, Ruby's RubyGems, and PHP’s Composer. We'll continue to add support for more ecosystems over time. For an overview of the package ecosystems that we support, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems)." - -It's worth noting that {% data variables.product.prodname_dotcom %} Security Advisories may exist for other ecosystems. The information in a security advisory is provided by the maintainers of a particular repository. This data is not curated in the same way as information for the supported ecosystems. {% ifversion fpt or ghec %}For more information, see "[About {% data variables.product.prodname_dotcom %} Security Advisories](/github/managing-security-vulnerabilities/about-github-security-advisories)."{% endif %} - -**Check**: Does the uncaught vulnerability apply to an unsupported ecosystem? - -## Does the dependency graph only find dependencies in manifests and lockfiles? - -The dependency graph includes information on dependencies that are explicitly declared in your environment. That is, dependencies that are specified in a manifest or a lockfile. The dependency graph generally also includes transitive dependencies, even when they aren't specified in a lockfile, by looking at the dependencies of the dependencies in a manifest file. +## Do {% data variables.product.prodname_dependabot_alerts %} only relate to vulnerable dependencies in manifests and lockfiles? {% data variables.product.prodname_dependabot_alerts %} advise you about dependencies you should update, including transitive dependencies, where the version can be determined from a manifest or a lockfile. {% ifversion fpt or ghec or ghes > 3.2 %}{% data variables.product.prodname_dependabot_security_updates %} only suggest a change where {% data variables.product.prodname_dependabot %} can directly "fix" the dependency, that is, when these are: * Direct dependencies explicitly declared in a manifest or lockfile * Transitive dependencies declared in a lockfile{% endif %} -The dependency graph doesn't include "loose" dependencies. "Loose" dependencies are individual files that are copied from another source and checked into the repository directly or within an archive (such as a ZIP or JAR file), rather than being referenced by in a package manager’s manifest or lockfile. - **Check**: Is the uncaught vulnerability for a component that's not specified in the repository's manifest or lockfile? -## Does the dependency graph detect dependencies specified using variables? - -The dependency graph analyzes manifests as they’re pushed to {% data variables.product.prodname_dotcom %}. The dependency graph doesn't, therefore, have access to the build environment of the project, so it can't resolve variables used within manifests. If you use variables within a manifest to specify the name, or more commonly the version of a dependency, then that dependency will not be included in the dependency graph. - -**Check**: Is the missing dependency declared in the manifest by using a variable for its name or version? - -## Are there limits which affect the dependency graph data? - -Yes, the dependency graph has two categories of limits: - -1. **Processing limits** - - These affect the dependency graph displayed within {% data variables.product.prodname_dotcom %} and also prevent {% data variables.product.prodname_dependabot_alerts %} being created. - - Manifests over 0.5 MB in size are only processed for enterprise accounts. For other accounts, manifests over 0.5 MB are ignored and will not create {% data variables.product.prodname_dependabot_alerts %}. - - By default, {% data variables.product.prodname_dotcom %} will not process more than 20 manifests per repository. {% data variables.product.prodname_dependabot_alerts %} are not created for manifests beyond this limit. If you need to increase the limit, contact {% data variables.contact.contact_support %}. - -2. **Visualization limits** +## Why don't I get vulnerability alerts for some ecosystems? - These affect what's displayed in the dependency graph within {% data variables.product.prodname_dotcom %}. However, they don't affect the {% data variables.product.prodname_dependabot_alerts %} that are created. +{% data variables.product.prodname_dotcom %} limits its support for vulnerability alerts to a set of ecosystems where we can provide high-quality, actionable data. Curated vulnerabilities in the {% data variables.product.prodname_advisory_database %}, the dependency graph, {% ifversion fpt or ghec %}{% data variables.product.prodname_dependabot %} security updates, {% endif %}and {% data variables.product.prodname_dependabot_alerts %} are provided for several ecosystems, including Java’s Maven, JavaScript’s npm and Yarn, .NET’s NuGet, Python’s pip, Ruby's RubyGems, and PHP’s Composer. We'll continue to add support for more ecosystems over time. For an overview of the package ecosystems that we support, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems)." - The Dependencies view of the dependency graph for a repository only displays 100 manifests. Typically this is adequate as it is significantly higher than the processing limit described above. In situations where the processing limit is over 100, {% data variables.product.prodname_dependabot_alerts %} are still created for any manifests that are not shown within {% data variables.product.prodname_dotcom %}. +It's worth noting that {% data variables.product.prodname_dotcom %} Security Advisories may exist for other ecosystems. The information in a security advisory is provided by the maintainers of a particular repository. This data is not curated in the same way as information for the supported ecosystems. {% ifversion fpt or ghec %}For more information, see "[About {% data variables.product.prodname_dotcom %} Security Advisories](/github/managing-security-vulnerabilities/about-github-security-advisories)."{% endif %} -**Check**: Is the missing dependency in a manifest file that's over 0.5 MB, or in a repository with a large number of manifests? +**Check**: Does the uncaught vulnerability apply to an unsupported ecosystem? ## Does {% data variables.product.prodname_dependabot %} generate alerts for vulnerabilities that have been known for many years? @@ -118,7 +86,8 @@ The {% data variables.product.prodname_dependabot_alerts %} count in {% data var ## Further reading -- "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)" -- "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" -- "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)"{% ifversion fpt or ghec or ghes > 3.2 %} +- "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)" +- "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" +- "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" +- "[Troubleshooting the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph)"{% ifversion fpt or ghec or ghes > 3.2 %} - "[Troubleshooting {% data variables.product.prodname_dependabot %} errors](/github/managing-security-vulnerabilities/troubleshooting-dependabot-errors)"{% endif %} diff --git a/content/code-security/getting-started/github-security-features.md b/content/code-security/getting-started/github-security-features.md index 19655b0a1854..21c6e0e3f757 100644 --- a/content/code-security/getting-started/github-security-features.md +++ b/content/code-security/getting-started/github-security-features.md @@ -37,7 +37,7 @@ Privately discuss and fix security vulnerabilities in your repository's code. Yo ### {% data variables.product.prodname_dependabot_alerts %} and security updates -View alerts about dependencies that are known to contain security vulnerabilities, and choose whether to have pull requests generated automatically to update these dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" +View alerts about dependencies that are known to contain security vulnerabilities, and choose whether to have pull requests generated automatically to update these dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates)." {% endif %} @@ -46,7 +46,7 @@ and "[About {% data variables.product.prodname_dependabot_security_updates %}](/ {% data reusables.dependabot.dependabot-alerts-beta %} -View alerts about dependencies that are known to contain security vulnerabilities, and manage these alerts. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +View alerts about dependencies that are known to contain security vulnerabilities, and manage these alerts. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." {% endif %} {% ifversion fpt or ghec or ghes > 3.2 %} diff --git a/content/code-security/getting-started/securing-your-organization.md b/content/code-security/getting-started/securing-your-organization.md index bd40761fcecb..667abbef4440 100644 --- a/content/code-security/getting-started/securing-your-organization.md +++ b/content/code-security/getting-started/securing-your-organization.md @@ -48,7 +48,7 @@ You can create a default security policy that will display in any of your organi {% data reusables.dependabot.dependabot-alerts-beta %} {% data reusables.dependabot.dependabot-alerts-dependency-graph-enterprise %} -For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)," "[Exploring the dependencies of a repository](/code-security/supply-chain-security/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)," and "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)." +For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)," "[Exploring the dependencies of a repository](/code-security/supply-chain-security/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)," and "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)." {% endif %} {% ifversion fpt or ghes > 3.1 or ghae-issue-4864 or ghec %} @@ -79,7 +79,7 @@ For more information, see "[About {% data variables.product.prodname_dependabot_ You can enable {% data variables.product.prodname_dependabot %} to automatically raise pull requests to keep your dependencies up-to-date. For more information, see "[About {% data variables.product.prodname_dependabot_version_updates %}](/code-security/supply-chain-security/about-dependabot-version-updates)." -To enable {% data variables.product.prodname_dependabot_version_updates %}, you must create a *dependabot.yml* configuration file. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +To enable {% data variables.product.prodname_dependabot_version_updates %}, you must create a *dependabot.yml* configuration file. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." {% endif %} @@ -135,7 +135,7 @@ For more information, see "[Managing security and analysis settings for your org ## Next steps {% ifversion fpt or ghes > 3.1 or ghec %}You can view, filter, and sort security alerts for repositories owned by your organization in the security overview. For more information, see "[About the security overview](/code-security/security-overview/about-the-security-overview)."{% endif %} -You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see {% ifversion fpt or ghes or ghec %} "[Viewing and updating vulnerable dependencies in your repository](/code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository),"{% endif %} {% ifversion fpt or ghec or ghes > 3.2 %}"[Managing pull requests for dependency updates](/code-security/supply-chain-security/managing-pull-requests-for-dependency-updates)," {% endif %}"[Managing {% data variables.product.prodname_code_scanning %} for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository)," and "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)." +You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see {% ifversion fpt or ghes or ghec %} "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository),"{% endif %} {% ifversion fpt or ghec or ghes > 3.2 %}"[Managing pull requests for dependency updates](/code-security/supply-chain-security/managing-pull-requests-for-dependency-updates)," {% endif %}"[Managing {% data variables.product.prodname_code_scanning %} for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository)," and "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)." {% ifversion fpt or ghec %}If you have a security vulnerability, you can create a security advisory to privately discuss and fix the vulnerability. For more information, see "[About {% data variables.product.prodname_security_advisories %}](/code-security/security-advisories/about-github-security-advisories)" and "[Creating a security advisory](/code-security/security-advisories/creating-a-security-advisory)." {% endif %} diff --git a/content/code-security/getting-started/securing-your-repository.md b/content/code-security/getting-started/securing-your-repository.md index 293eb3185b54..1073b342f8cb 100644 --- a/content/code-security/getting-started/securing-your-repository.md +++ b/content/code-security/getting-started/securing-your-repository.md @@ -75,7 +75,7 @@ For more information, see "[Exploring the dependencies of a repository](/code-se {% data reusables.dependabot.dependabot-alerts-beta %} {% data reusables.dependabot.dependabot-alerts-dependency-graph-enterprise %} -For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies){% ifversion fpt or ghec %}" and "[Managing security and analysis settings for your user account](/github/setting-up-and-managing-your-github-user-account/managing-security-and-analysis-settings-for-your-user-account){% endif %}." +For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies){% ifversion fpt or ghec %}" and "[Managing security and analysis settings for your user account](/github/setting-up-and-managing-your-github-user-account/managing-security-and-analysis-settings-for-your-user-account){% endif %}." {% endif %} @@ -111,7 +111,7 @@ For more information, see "[About {% data variables.product.prodname_dependabot_ You can enable {% data variables.product.prodname_dependabot %} to automatically raise pull requests to keep your dependencies up-to-date. For more information, see "[About {% data variables.product.prodname_dependabot_version_updates %}](/code-security/supply-chain-security/about-dependabot-version-updates)." -To enable {% data variables.product.prodname_dependabot_version_updates %}, you must create a *dependabot.yml* configuration file. For more information, see "[Enabling and disabling {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." +To enable {% data variables.product.prodname_dependabot_version_updates %}, you must create a *dependabot.yml* configuration file. For more information, see "[Configuring {% data variables.product.prodname_dependabot %} version updates](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates)." {% endif %} @@ -132,7 +132,7 @@ You can set up {% data variables.product.prodname_code_scanning %} to automatica {% endif %} ## Next steps -You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see {% ifversion fpt or ghes or ghec %} "[Viewing and updating vulnerable dependencies in your repository](/code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository),"{% endif %} {% ifversion fpt or ghec or ghes > 3.2 %}"[Managing pull requests for dependency updates](/code-security/supply-chain-security/managing-pull-requests-for-dependency-updates)," {% endif %}"[Managing {% data variables.product.prodname_code_scanning %} for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository)," and "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)." +You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see {% ifversion fpt or ghes or ghec %} "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository),"{% endif %} {% ifversion fpt or ghec or ghes > 3.2 %}"[Managing pull requests for dependency updates](/code-security/supply-chain-security/managing-pull-requests-for-dependency-updates)," {% endif %}"[Managing {% data variables.product.prodname_code_scanning %} for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository)," and "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)." {% ifversion fpt or ghec %}If you have a security vulnerability, you can create a security advisory to privately discuss and fix the vulnerability. For more information, see "[About {% data variables.product.prodname_security_advisories %}](/code-security/security-advisories/about-github-security-advisories)" and "[Creating a security advisory](/code-security/security-advisories/creating-a-security-advisory)." {% endif %} diff --git a/content/code-security/guides.md b/content/code-security/guides.md index 5a086ef6937b..f039f78ff477 100644 --- a/content/code-security/guides.md +++ b/content/code-security/guides.md @@ -75,7 +75,6 @@ includeGuides: - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-managing-vulnerable-dependencies - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/browsing-security-vulnerabilities-in-the-github-advisory-database - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates diff --git a/content/code-security/index.md b/content/code-security/index.md index 19f3861138df..e7248afec2a2 100644 --- a/content/code-security/index.md +++ b/content/code-security/index.md @@ -54,6 +54,7 @@ children: - /code-scanning - /repository-security-advisories - /supply-chain-security + - /dependabot - /security-overview - /guides --- diff --git a/content/code-security/security-overview/about-the-security-overview.md b/content/code-security/security-overview/about-the-security-overview.md index 8cfb95f56e21..5227039b4fb8 100644 --- a/content/code-security/security-overview/about-the-security-overview.md +++ b/content/code-security/security-overview/about-the-security-overview.md @@ -28,7 +28,7 @@ shortTitle: About security overview You can use the security overview for a high-level view of the security status of your organization or to identify problematic repositories that require intervention. You can view aggregate or repository-specific security information in the security overview. You can also use the security overview to see which security features are enabled for your repositories and to configure any available security features that are not currently in use. -The security overview indicates whether {% ifversion fpt or ghes > 3.1 or ghec %}security{% endif %}{% ifversion ghae %}{% data variables.product.prodname_GH_advanced_security %}{% endif %} features are enabled for repositories owned by your organization and consolidates alerts for each feature.{% ifversion fpt or ghes > 3.1 or ghec %} Security features include {% data variables.product.prodname_GH_advanced_security %} features, such as {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_secret_scanning %}, as well as {% data variables.product.prodname_dependabot_alerts %}.{% endif %} For more information about {% data variables.product.prodname_GH_advanced_security %} features, see "[About {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)."{% ifversion fpt or ghes > 3.1 or ghec %} For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)."{% endif %} +The security overview indicates whether {% ifversion fpt or ghes > 3.1 or ghec %}security{% endif %}{% ifversion ghae %}{% data variables.product.prodname_GH_advanced_security %}{% endif %} features are enabled for repositories owned by your organization and consolidates alerts for each feature.{% ifversion fpt or ghes > 3.1 or ghec %} Security features include {% data variables.product.prodname_GH_advanced_security %} features, such as {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_secret_scanning %}, as well as {% data variables.product.prodname_dependabot_alerts %}.{% endif %} For more information about {% data variables.product.prodname_GH_advanced_security %} features, see "[About {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)."{% ifversion fpt or ghes > 3.1 or ghec %} For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)."{% endif %} For more information about securing your code at the repository and organization levels, see "[Securing your repository](/code-security/getting-started/securing-your-repository)" and "[Securing your organization](/code-security/getting-started/securing-your-organization)." @@ -54,7 +54,7 @@ For each repository in the security overview, you will see icons for each type o | -------- | -------- | | {% octicon "code-square" aria-label="Code scanning alerts" %} | {% data variables.product.prodname_code_scanning_capc %} alerts. For more information, see "[About {% data variables.product.prodname_code_scanning %}](/code-security/secure-coding/about-code-scanning)." | | {% octicon "key" aria-label="Secret scanning alerts" %} | {% data variables.product.prodname_secret_scanning_caps %} alerts. For more information, see "[About {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/about-secret-scanning)." | -| {% octicon "hubot" aria-label="Dependabot alerts" %} | {% data variables.product.prodname_dependabot_alerts %}. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." | +| {% octicon "hubot" aria-label="Dependabot alerts" %} | {% data variables.product.prodname_dependabot_alerts %}. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." | | {% octicon "check" aria-label="Check" %} | The security feature is enabled, but does not raise alerts in this repository. | | {% octicon "x" aria-label="x" %} | The security feature is not supported in this repository. | diff --git a/content/code-security/supply-chain-security/index.md b/content/code-security/supply-chain-security/index.md index 6676ac8a44c3..920263b97190 100644 --- a/content/code-security/supply-chain-security/index.md +++ b/content/code-security/supply-chain-security/index.md @@ -16,8 +16,6 @@ topics: - Repositories children: - /understanding-your-software-supply-chain - - /keeping-your-dependencies-updated-automatically - - /managing-vulnerabilities-in-your-projects-dependencies - /end-to-end-supply-chain --- diff --git a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/index.md b/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/index.md deleted file mode 100644 index e01e8e11160b..000000000000 --- a/content/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Keeping your dependencies updated automatically -intro: '{% data variables.product.prodname_dependabot %} can maintain your repository''s dependencies automatically.' -redirect_from: - - /github/administering-a-repository/keeping-your-dependencies-updated-automatically -versions: - fpt: '*' - ghec: '*' - ghes: '>3.2' -topics: - - Repositories - - Dependabot - - Version updates - - Dependencies - - Pull requests -children: - - /about-dependabot-version-updates - - /enabling-and-disabling-dependabot-version-updates - - /listing-dependencies-configured-for-version-updates - - /managing-pull-requests-for-dependency-updates - - /automating-dependabot-with-github-actions - - /managing-encrypted-secrets-for-dependabot - - /customizing-dependency-updates - - /configuration-options-for-dependency-updates - - /keeping-your-actions-up-to-date-with-dependabot -shortTitle: Auto-update dependencies ---- - -{% data reusables.dependabot.beta-security-and-version-updates %} diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-managing-vulnerable-dependencies.md b/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-managing-vulnerable-dependencies.md deleted file mode 100644 index ee0c826d039e..000000000000 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-managing-vulnerable-dependencies.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: About managing vulnerable dependencies -intro: '{% data variables.product.product_name %} helps you to avoid using third-party software that contains known vulnerabilities.' -redirect_from: - - /github/managing-security-vulnerabilities/about-managing-vulnerable-dependencies - - /code-security/supply-chain-security/about-managing-vulnerable-dependencies -versions: - fpt: '*' - ghes: '>=3.2' - ghae: issue-4864 - ghec: '*' -type: overview -topics: - - Dependabot - - Dependency graph - - Dependency review - - Vulnerabilities - - Repositories - - Dependencies - - Pull requests -shortTitle: Vulnerable dependencies ---- - - -{% data variables.product.product_name %} provides the following tools for removing and avoiding vulnerable dependencies. - -## Dependency graph -The dependency graph is a summary of the manifest and lock files stored in a repository. It shows you the ecosystems and packages your codebase depends on (its dependencies) and the repositories and packages that depend on your project (its dependents). The information in the dependency graph is used by dependency review and {% data variables.product.prodname_dependabot %}. -For more information, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)." - -## Dependency review - -{% data reusables.dependency-review.beta %} - -By checking the dependency reviews on pull requests you can avoid introducing vulnerabilities from dependencies into your codebase. If the pull requests adds a vulnerable dependency, or changes a dependency to a vulnerable version, this is highlighted in the dependency review. You can change the dependency to a patched version before merging the pull request. For more information, see "[About dependency review](/code-security/supply-chain-security/about-dependency-review)." - -## {% data variables.product.prodname_dependabot_alerts %} -{% data variables.product.product_name %} can create {% data variables.product.prodname_dependabot_alerts %} when it detects vulnerable dependencies in your repository. The alert is displayed on the Security tab for the repository. The alert includes a link to the affected file in the project, and information about a fixed version. {% data variables.product.product_name %} also notifies the maintainers of the repository, according to their notification preferences. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)." - -{% ifversion fpt or ghec or ghes > 3.2 %} -## {% data variables.product.prodname_dependabot_security_updates %} -When {% data variables.product.product_name %} generates a {% data variables.product.prodname_dependabot %} alert for a vulnerable dependency in your repository, {% data variables.product.prodname_dependabot %} can automatically try to fix it for you. {% data variables.product.prodname_dependabot_security_updates %} are automatically generated pull requests that update a vulnerable dependency to a fixed version. For more information, see "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates)." - -## {% data variables.product.prodname_dependabot_version_updates %} -Enabling {% data variables.product.prodname_dependabot_version_updates %} takes the effort out of maintaining your dependencies. With {% data variables.product.prodname_dependabot_version_updates %}, whenever {% data variables.product.prodname_dotcom %} identifies an outdated dependency, it raises a pull request to update the manifest to the latest version of the dependency. By contrast, {% data variables.product.prodname_dependabot_security_updates %} only raises pull requests to fix vulnerable dependencies. For more information, see "[About Dependabot version updates](/github/administering-a-repository/about-dependabot-version-updates)." -{% endif %} diff --git a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/index.md b/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/index.md deleted file mode 100644 index a86e842f2d82..000000000000 --- a/content/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/index.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Managing vulnerabilities in your project's dependencies -intro: 'You can track your repository''s dependencies and receive {% data variables.product.prodname_dependabot_alerts %} when {% data variables.product.product_name %} detects vulnerable dependencies.' -redirect_from: - - /articles/updating-your-project-s-dependencies - - /articles/updating-your-projects-dependencies - - /articles/managing-security-vulnerabilities-in-your-projects-dependencies - - /articles/managing-vulnerabilities-in-your-projects-dependencies - - /github/managing-security-vulnerabilities/managing-vulnerabilities-in-your-projects-dependencies -versions: - fpt: '*' - ghes: '*' - ghae: issue-4864 - ghec: '*' -topics: - - Repositories - - Dependabot - - Version updates - - Dependencies - - Pull requests - - Vulnerabilities - - Alerts -children: - - /about-managing-vulnerable-dependencies - - /browsing-security-vulnerabilities-in-the-github-advisory-database - - /editing-security-advisories-in-the-github-advisory-database - - /about-alerts-for-vulnerable-dependencies - - /configuring-notifications-for-vulnerable-dependencies - - /about-dependabot-security-updates - - /configuring-dependabot-security-updates - - /viewing-and-updating-vulnerable-dependencies-in-your-repository - - /troubleshooting-the-detection-of-vulnerable-dependencies - - /troubleshooting-dependabot-errors -shortTitle: Fix vulnerable dependencies ---- - diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md index a6b5986909dd..fdc3d5e35b20 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md @@ -41,7 +41,7 @@ Sometimes you might just want to update the version of one dependency in a manif By checking the dependency reviews in a pull request, and changing any dependencies that are flagged as vulnerable, you can avoid vulnerabilities being added to your project. For more information about how dependency review works, see "[Reviewing dependency changes in a pull request](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)." -{% data variables.product.prodname_dependabot_alerts %} will find vulnerabilities that are already in your dependencies, but it's much better to avoid introducing potential problems than to fix problems at a later date. For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)." +{% data variables.product.prodname_dependabot_alerts %} will find vulnerabilities that are already in your dependencies, but it's much better to avoid introducing potential problems than to fix problems at a later date. For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)." Dependency review supports the same languages and package management ecosystems as the dependency graph. For more information, see "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems)." @@ -49,4 +49,4 @@ Dependency review supports the same languages and package management ecosystems ## Enabling dependency review The dependency review feature becomes available when you enable the dependency graph. {% ifversion ghec %}For more information, see "[Enabling the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph#enabling-the-dependency-graph)."{% endif %}{% ifversion ghes or ghae %}For more information, see "[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)."{% endif %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md index 53c972c93fa8..91b871b9efcf 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md @@ -55,7 +55,7 @@ You can use the dependency graph to: - Explore the repositories your code depends on{% ifversion fpt or ghec %}, and those that depend on it{% endif %}. For more information, see "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository)." {% ifversion fpt or ghec %} - View a summary of the dependencies used in your organization's repositories in a single dashboard. For more information, see "[Viewing insights for your organization](/articles/viewing-insights-for-your-organization#viewing-organization-dependency-insights)."{% endif %} -- View and update vulnerable dependencies for your repository. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)."{% ifversion fpt or ghes > 3.1 or ghec %} +- View and update vulnerable dependencies for your repository. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)."{% ifversion fpt or ghes > 3.1 or ghec %} - See information about vulnerable dependencies in pull requests. For more information, see "[Reviewing dependency changes in a pull request](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)."{% endif %} ## Enabling the dependency graph @@ -111,5 +111,5 @@ The recommended formats explicitly define which versions are used for all direct - "[Dependency graph](https://en.wikipedia.org/wiki/Dependency_graph)" on Wikipedia - "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository)"{% ifversion fpt or ghec %} - "[Viewing insights for your organization](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)"{% endif %} -- "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" +- "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" - "[Troubleshooting the detection of vulnerable dependencies](/github/managing-security-vulnerabilities/troubleshooting-the-detection-of-vulnerable-dependencies)" diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md index eb300803ce8b..8b1c81aaf8b0 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md @@ -117,7 +117,7 @@ If a manifest or lock file is not processed, its dependencies are omitted from t ## Further reading - "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)" -- "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)"{% ifversion fpt or ghec %} +- "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)"{% ifversion fpt or ghec %} - "[Viewing insights for your organization](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)" - "[Understanding how {% data variables.product.prodname_dotcom %} uses and protects your data](/get-started/privacy-on-github)" {% endif %} diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/index.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/index.md index 0e1e4f1579d7..d690614ed13b 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/index.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/index.md @@ -9,10 +9,11 @@ topics: - Dependency graph - Dependencies - Repositories +shortTitle: Understand your supply chain children: - /about-the-dependency-graph - - /exploring-the-dependencies-of-a-repository - /about-dependency-review -shortTitle: Understand your supply chain + - /exploring-the-dependencies-of-a-repository + - /troubleshooting-the-dependency-graph --- diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph.md new file mode 100644 index 000000000000..6de1b7a25da5 --- /dev/null +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph.md @@ -0,0 +1,62 @@ +--- +title: Troubleshooting the dependency graph +intro: 'If the dependency information reported by the dependency graph is not what you expected, there are a number of points to consider, and various things you can check.' +shortTitle: Troubleshoot dependency graph +versions: + fpt: '*' + ghes: '*' + ghae: issue-4864 + ghec: '*' +type: how_to +topics: + - Troubleshooting + - Errors + - Dependencies + - Vulnerabilities + - Dependency graph + - CVEs + - Repositories +--- + +{% data reusables.dependabot.result-discrepancy %} + +## Does the dependency graph only find dependencies in manifests and lockfiles? + +The dependency graph includes information on dependencies that are explicitly declared in your environment. That is, dependencies that are specified in a manifest or a lockfile. The dependency graph generally also includes transitive dependencies, even when they aren't specified in a lockfile, by looking at the dependencies of the dependencies in a manifest file. + +The dependency graph doesn't include "loose" dependencies. "Loose" dependencies are individual files that are copied from another source and checked into the repository directly or within an archive (such as a ZIP or JAR file), rather than being referenced by in a package manager’s manifest or lockfile. + +**Check**: Is the missing dependency for a component that's not specified in the repository's manifest or lockfile? + +## Does the dependency graph detect dependencies specified using variables? + +The dependency graph analyzes manifests as they’re pushed to {% data variables.product.prodname_dotcom %}. The dependency graph doesn't, therefore, have access to the build environment of the project, so it can't resolve variables used within manifests. If you use variables within a manifest to specify the name, or more commonly the version of a dependency, then that dependency will not be included in the dependency graph. + +**Check**: Is the missing dependency declared in the manifest by using a variable for its name or version? + +## Are there limits which affect the dependency graph data? + +Yes, the dependency graph has two categories of limits: + +1. **Processing limits** + + These affect the dependency graph displayed within {% data variables.product.prodname_dotcom %} and also prevent {% data variables.product.prodname_dependabot_alerts %} being created. + + Manifests over 0.5 MB in size are only processed for enterprise accounts. For other accounts, manifests over 0.5 MB are ignored and will not create {% data variables.product.prodname_dependabot_alerts %}. + + By default, {% data variables.product.prodname_dotcom %} will not process more than 20 manifests per repository. {% data variables.product.prodname_dependabot_alerts %} are not created for manifests beyond this limit. If you need to increase the limit, contact {% data variables.contact.contact_support %}. + +2. **Visualization limits** + + These affect what's displayed in the dependency graph within {% data variables.product.prodname_dotcom %}. However, they don't affect the {% data variables.product.prodname_dependabot_alerts %} that are created. + + The Dependencies view of the dependency graph for a repository only displays 100 manifests. Typically this is adequate as it is significantly higher than the processing limit described above. In situations where the processing limit is over 100, {% data variables.product.prodname_dependabot_alerts %} are still created for any manifests that are not shown within {% data variables.product.prodname_dotcom %}. + +**Check**: Is the missing dependency in a manifest file that's over 0.5 MB, or in a repository with a large number of manifests? + +## Further reading + +- "[About the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)" +- "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" +- "[Troubleshooting the detection of vulnerable dependencies](/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies)"{% ifversion fpt or ghec or ghes > 3.2 %} +- "[Troubleshooting {% data variables.product.prodname_dependabot %} errors](/github/managing-security-vulnerabilities/troubleshooting-dependabot-errors)"{% endif %} \ No newline at end of file diff --git a/content/developers/apps/building-github-apps/creating-a-github-app-using-url-parameters.md b/content/developers/apps/building-github-apps/creating-a-github-app-using-url-parameters.md index bb9208c4bd63..2f2596db9011 100644 --- a/content/developers/apps/building-github-apps/creating-a-github-app-using-url-parameters.md +++ b/content/developers/apps/building-github-apps/creating-a-github-app-using-url-parameters.md @@ -89,7 +89,7 @@ Permission | Description [`starring`](/rest/reference/permissions-required-for-github-apps/#permission-on-starring) | Grants access to the [Starring API](/rest/reference/activity#starring). Can be one of: `none`, `read`, or `write`. [`statuses`](/rest/reference/permissions-required-for-github-apps/#permission-on-statuses) | Grants access to the [Statuses API](/rest/reference/commits#commit-statuses). Can be one of: `none`, `read`, or `write`. [`team_discussions`](/rest/reference/permissions-required-for-github-apps/#permission-on-team-discussions) | Grants access to the [Team Discussions API](/rest/reference/teams#discussions) and the [Team Discussion Comments API](/rest/reference/teams#discussion-comments). Can be one of: `none`, `read`, or `write`.{% ifversion fpt or ghes or ghae-issue-4864 or ghec %} -`vulnerability_alerts`| Grants access to receive security alerts for vulnerable dependencies in a repository. See "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)" to learn more. Can be one of: `none` or `read`.{% endif %} +`vulnerability_alerts`| Grants access to receive {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies in a repository. See "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)" to learn more. Can be one of: `none` or `read`.{% endif %} `watching` | Grants access to list and change repositories a user is subscribed to. Can be one of: `none`, `read`, or `write`. ## {% data variables.product.prodname_github_app %} webhook events diff --git a/content/developers/webhooks-and-events/webhooks/webhook-events-and-payloads.md b/content/developers/webhooks-and-events/webhooks/webhook-events-and-payloads.md index 54befbadb169..65142bbe0406 100644 --- a/content/developers/webhooks-and-events/webhooks/webhook-events-and-payloads.md +++ b/content/developers/webhooks-and-events/webhooks/webhook-events-and-payloads.md @@ -1244,7 +1244,7 @@ Key | Type | Description Activity related to a security advisory that has been reviewed by {% data variables.product.company_short %}. A {% data variables.product.company_short %}-reviewed security advisory provides information about security-related vulnerabilities in software on {% data variables.product.prodname_dotcom %}. -The security advisory dataset also powers the GitHub {% data variables.product.prodname_dependabot_alerts %}. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)." +The security advisory dataset also powers the GitHub {% data variables.product.prodname_dependabot_alerts %}. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)." ### Availability diff --git a/content/get-started/privacy-on-github/about-githubs-use-of-your-data.md b/content/get-started/privacy-on-github/about-githubs-use-of-your-data.md index ef8f0ba1e26a..fc87f2d848db 100644 --- a/content/get-started/privacy-on-github/about-githubs-use-of-your-data.md +++ b/content/get-started/privacy-on-github/about-githubs-use-of-your-data.md @@ -28,7 +28,7 @@ We'll announce substantial new features that use metadata or aggregate data on t ## How data improves security recommendations -As an example of how your data might be used, we can detect and alert you to a security vulnerability in your public repository's dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +As an example of how your data might be used, we can detect and alert you to a security vulnerability in your public repository's dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." To detect potential security vulnerabilities, {% data variables.product.product_name %} scans the contents of your dependency manifest file to draw a list of your project's dependencies. diff --git a/content/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository.md b/content/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository.md index 8229beefb99a..d7b42f45ee61 100644 --- a/content/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository.md +++ b/content/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository.md @@ -16,7 +16,7 @@ shortTitle: Manage data use for private repo ## About data use for your private repository -When you enable data use for your private repository, you'll be able to access the dependency graph, where you can track your repository's dependencies and receive {% data variables.product.prodname_dependabot_alerts %} when {% data variables.product.product_name %} detects vulnerable dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)." +When you enable data use for your private repository, you'll be able to access the dependency graph, where you can track your repository's dependencies and receive {% data variables.product.prodname_dependabot_alerts %} when {% data variables.product.product_name %} detects vulnerable dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)." ## Enabling or disabling data use features @@ -32,5 +32,5 @@ When you enable data use for your private repository, you'll be able to access t ## Further reading - "[About {% data variables.product.prodname_dotcom %}'s use of your data](/articles/about-github-s-use-of-your-data)" -- "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" +- "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)" - "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" diff --git a/content/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server.md b/content/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server.md index 1328f5458054..7e14e81eae3e 100644 --- a/content/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server.md +++ b/content/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server.md @@ -18,7 +18,7 @@ shortTitle: Enterprise Server trial You can request a 45-day trial to evaluate {% data variables.product.prodname_ghe_server %}. Your trial will be installed as a virtual appliance, with options for on-premises or cloud deployment. For a list of supported visualization platforms, see "[Setting up a GitHub Enterprise Server instance](/enterprise-server@latest/admin/installation/setting-up-a-github-enterprise-server-instance)." -{% ifversion ghes %}{% data variables.product.prodname_dependabot %}{% else %}Security{% endif %} alerts and {% data variables.product.prodname_github_connect %} are not currently available in trials of {% data variables.product.prodname_ghe_server %}. For a demonstration of these features, contact {% data variables.contact.contact_enterprise_sales %}. For more information about these features, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" and "[Connecting your enterprise account to {% data variables.product.prodname_ghe_cloud %}](/enterprise-server@latest/admin/configuration/managing-connections-between-your-enterprise-accounts/connecting-your-enterprise-account-to-github-enterprise-cloud)." +{% ifversion ghes %}{% data variables.product.prodname_dependabot %}{% else %}Security{% endif %} alerts and {% data variables.product.prodname_github_connect %} are not currently available in trials of {% data variables.product.prodname_ghe_server %}. For a demonstration of these features, contact {% data variables.contact.contact_enterprise_sales %}. For more information about these features, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" and "[Connecting your enterprise account to {% data variables.product.prodname_ghe_cloud %}](/enterprise-server@latest/admin/configuration/managing-connections-between-your-enterprise-accounts/connecting-your-enterprise-account-to-github-enterprise-cloud)." Trials are also available for {% data variables.product.prodname_ghe_cloud %}. For more information, see "[Setting up a trial of {% data variables.product.prodname_ghe_cloud %}](/articles/setting-up-a-trial-of-github-enterprise-cloud)." diff --git a/content/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.md b/content/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.md index d1694f57b370..8069f9a67ca0 100644 --- a/content/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.md +++ b/content/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.md @@ -69,10 +69,9 @@ We use [Linguist](https://github.com/github/linguist) to perform language detect {% if mermaid %} ## Creating diagrams -You can use Mermaid syntax to add diagrams. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams)." +You can also use code blocks to create diagrams in Markdown. GitHub supports Mermaid, geoJSON, topoJSON, and ASCII STL syntax. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams)." {% endif %} - ## Further reading - [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/) diff --git a/content/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams.md b/content/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams.md index 4f4f1a2e267c..c91e57029b93 100644 --- a/content/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams.md +++ b/content/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams.md @@ -6,7 +6,13 @@ versions: shortTitle: Create diagrams --- -You can use Mermaid syntax to create diagrams. Mermaid is a Markdown-inspired tool that renders text into diagrams. For example, Mermaid can render flow charts, sequence diagrams, pie charts and more. For more information, see the [Mermaid documentation](https://mermaid-js.github.io/mermaid/#/). +## About creating diagrams + +You can create diagrams in Markdown using three different syntaxes: mermaid, geoJSON and topoJSON, and ASCII STL. + +## Creating Mermaid diagrams + +Mermaid is a Markdown-inspired tool that renders text into diagrams. For example, Mermaid can render flow charts, sequence diagrams, pie charts and more. For more information, see the [Mermaid documentation](https://mermaid-js.github.io/mermaid/#/). To create a Mermaid diagram, add Mermaid syntax inside a fenced code block with the `mermaid` language identifier. For more information about creating code blocks, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)." @@ -31,3 +37,122 @@ graph TD; **Note:** You may observe errors if you run a third-party Mermaid plugin when using Mermaid syntax on {% data variables.product.company_short %}. {% endnote %} + +## Creating geoJSON and topoJSON maps + +You can use geo/topoJSON syntax to create interactive maps. To create a map, add geoJSON or topoJSON inside a fenced code block with the `geojson` or `topojson` syntax identifier. For more information, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)." + +### Using geoJSON + +For example, you can create a simple map: + +
+```geojson
+{
+  "type": "Polygon",
+  "coordinates": [
+      [
+          [-90,30],
+          [-90,35],
+          [-90,35],
+          [-85,35],
+          [-85,30]
+      ]
+  ]
+}
+```
+
+ +![Rendered map](/assets/images/help/writing/fenced-geojson-rendered-map.png) + +### Using topoJSON + +For example, you can create a simple topoJSON map: + +
+```topojson
+{
+  "type": "Topology",
+  "transform": {
+    "scale": [0.0005000500050005, 0.00010001000100010001],
+    "translate": [100, 0]
+  },
+  "objects": {
+    "example": {
+      "type": "GeometryCollection",
+      "geometries": [
+        {
+          "type": "Point",
+          "properties": {"prop0": "value0"},
+          "coordinates": [4000, 5000]
+        },
+        {
+          "type": "LineString",
+          "properties": {"prop0": "value0", "prop1": 0},
+          "arcs": [0]
+        },
+        {
+          "type": "Polygon",
+          "properties": {"prop0": "value0",
+            "prop1": {"this": "that"}
+          },
+          "arcs": [[1]]
+        }
+      ]
+    }
+  },
+  "arcs": [[[4000, 0], [1999, 9999], [2000, -9999], [2000, 9999]],[[0, 0], [0, 9999], [2000, 0], [0, -9999], [-2000, 0]]]
+}
+```
+
+ +![Rendered topojson map](/assets/images/help/writing/fenced-topojson-rendered-map.png) + +For more information on working with `.geojson` and `.topojson` files, see "[Working with non-code files](/repositories/working-with-files/using-files/working-with-non-code-files#mapping-geojson-files-on-github)." + + +## Creating STL 3D models + +You can use ASCII STL syntax directly in markdown to create interactive 3D models. To display a model, add ASCII STL syntax inside a fenced code block with the `stl` syntax identifier. For more information, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)." + +For example, you can create a simple 3D model: + +
+```stl
+solid cube_corner
+  facet normal 0.0 -1.0 0.0
+    outer loop
+      vertex 0.0 0.0 0.0
+      vertex 1.0 0.0 0.0
+      vertex 0.0 0.0 1.0
+    endloop
+  endfacet
+  facet normal 0.0 0.0 -1.0
+    outer loop
+      vertex 0.0 0.0 0.0
+      vertex 0.0 1.0 0.0
+      vertex 1.0 0.0 0.0
+    endloop
+  endfacet
+  facet normal -1.0 0.0 0.0
+    outer loop
+      vertex 0.0 0.0 0.0
+      vertex 0.0 0.0 1.0
+      vertex 0.0 1.0 0.0
+    endloop
+  endfacet
+  facet normal 0.577 0.577 0.577
+    outer loop
+      vertex 1.0 0.0 0.0
+      vertex 0.0 1.0 0.0
+      vertex 0.0 0.0 1.0
+    endloop
+  endfacet
+endsolid
+```
+
+ +![Rendered 3D model](/assets/images/help/writing/fenced-stl-rendered-object.png) + +For more information on working with `.stl` files, see "[Working with non-code files](/repositories/working-with-files/using-files/working-with-non-code-files#3d-file-viewer)." + diff --git a/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization.md b/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization.md index 535f165c2533..67055d249caf 100644 --- a/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization.md +++ b/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization.md @@ -123,7 +123,7 @@ You can enable or disable features for all repositories. By default, {% data variables.product.prodname_dependabot %} can't update dependencies that are located in private repositories or private package registries. However, if a dependency is in a private {% data variables.product.prodname_dotcom %} repository within the same organization as the project that uses that dependency, you can allow {% data variables.product.prodname_dependabot %} to update the version successfully by giving it access to the host repository. -If your code depends on packages in a private registry, you can allow {% data variables.product.prodname_dependabot %} to update the versions of these dependencies by configuring this at the repository level. You do this by adding authentication details to the _dependabot.yml_ file for the repository. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." +If your code depends on packages in a private registry, you can allow {% data variables.product.prodname_dependabot %} to update the versions of these dependencies by configuring this at the repository level. You do this by adding authentication details to the _dependabot.yml_ file for the repository. For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." To allow {% data variables.product.prodname_dependabot %} to access a private {% data variables.product.prodname_dotcom %} repository: @@ -163,6 +163,5 @@ You can manage access to {% data variables.product.prodname_GH_advanced_security - "[Securing your repository](/code-security/getting-started/securing-your-repository)"{% ifversion not fpt %} - "[About secret scanning](/github/administering-a-repository/about-secret-scanning)"{% endif %}{% ifversion not ghae %} -- "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)" -- "[Managing vulnerabilities in your project's dependencies](/github/managing-security-vulnerabilities/managing-vulnerabilities-in-your-projects-dependencies)"{% endif %}{% ifversion fpt or ghec or ghes > 3.2 %} -- "[Keeping your dependencies updated automatically](/github/administering-a-repository/keeping-your-dependencies-updated-automatically)"{% endif %} +- "[About the dependency graph](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)"{% endif %}{% ifversion fpt or ghec or ghes > 3.2 %} +- "[Keeping your dependencies updated automatically](/github/administering-a-repository/keeping-your-dependencies-updated-automatically)"{% endif %} \ No newline at end of file diff --git a/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md b/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md index a79bd3321e0a..f6d67a50f8f8 100644 --- a/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md +++ b/content/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization.md @@ -42,7 +42,7 @@ To search for specific events, use the `action` qualifier in your query. Actions | [`billing`](#billing-category-actions) | Contains all activities related to your organization's billing. | [`business`](#business-category-actions) | Contains activities related to business settings for an enterprise. | | [`codespaces`](#codespaces-category-actions) | Contains all activities related to your organization's codespaces. |{% endif %}{% ifversion fpt or ghec or ghes > 3.2 %} -| [`dependabot_alerts`](#dependabot_alerts-category-actions) | Contains organization-level configuration activities for {% data variables.product.prodname_dependabot_alerts %} in existing repositories. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +| [`dependabot_alerts`](#dependabot_alerts-category-actions) | Contains organization-level configuration activities for {% data variables.product.prodname_dependabot_alerts %} in existing repositories. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." | [`dependabot_alerts_new_repos`](#dependabot_alerts_new_repos-category-actions) | Contains organization-level configuration activities for {% data variables.product.prodname_dependabot_alerts %} in new repositories created in the organization. | [`dependabot_security_updates`](#dependabot_security_updates-category-actions) | Contains organization-level configuration activities for {% data variables.product.prodname_dependabot_security_updates %} in existing repositories. For more information, see "[Configuring {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/configuring-dependabot-security-updates)." | [`dependabot_security_updates_new_repos`](#dependabot_security_updates_new_repos-category-actions) | Contains organization-level configuration activities for {% data variables.product.prodname_dependabot_security_updates %} for new repositories created in the organization.{% endif %}{% ifversion fpt or ghec %} @@ -680,7 +680,7 @@ For more information, see "[Managing the publication of {% data variables.produc | Action | Description |------------------|------------------- -| `create` | Triggered when {% data variables.product.product_name %} creates a {% data variables.product.prodname_dependabot %} alert for a repository that uses a vulnerable dependency. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +| `create` | Triggered when {% data variables.product.product_name %} creates a {% data variables.product.prodname_dependabot %} alert for a repository that uses a vulnerable dependency. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." | `dismiss` | Triggered when an organization owner or person with admin access to the repository dismisses a {% data variables.product.prodname_dependabot %} alert about a vulnerable dependency. | `resolve` | Triggered when someone with write access to a repository pushes changes to update and resolve a vulnerability in a project dependency. diff --git a/content/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories.md b/content/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories.md index 29e586ab412a..890f1e122aa8 100644 --- a/content/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories.md +++ b/content/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories.md @@ -75,5 +75,5 @@ Almost all software relies on code developed and maintained by other developers, The dependency graph provides a great way to visualize and explore the dependencies for a repository. For more information, see "[About the dependency graph](/code-security/supply-chain-security/about-the-dependency-graph)" and "[Exploring the dependencies of a repository](/code-security/supply-chain-security/exploring-the-dependencies-of-a-repository)." -You can also set up your repository so that {% data variables.product.company_short %} alerts you automatically whenever a security vulnerability is found in one of your dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +You can also set up your repository so that {% data variables.product.company_short %} alerts you automatically whenever a security vulnerability is found in one of your dependencies. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." {% endif %} diff --git a/content/repositories/working-with-files/using-files/working-with-non-code-files.md b/content/repositories/working-with-files/using-files/working-with-non-code-files.md index 2623fdbd3608..9924bdee5a7a 100644 --- a/content/repositories/working-with-files/using-files/working-with-non-code-files.md +++ b/content/repositories/working-with-files/using-files/working-with-non-code-files.md @@ -130,6 +130,12 @@ By default, the embedded renderer is 420 pixels wide by 620 pixels high, but you {% endtip %} +{% if mermaid %} +### Rendering in Markdown + +You can embed ASCII STL syntax directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-stl-3d-models)." +{% endif %} + ## Rendering CSV and TSV data GitHub supports rendering tabular data in the form of *.csv* (comma-separated) and .*tsv* (tab-separated) files. @@ -240,7 +246,7 @@ When you click the paper icon on the right, you'll also see the changes made to ![Source Render toggle screenshot](/assets/images/help/repository/source-render-toggle-geojson.png) -### Geometry Types +### Geometry types Maps on {% data variables.product.product_name %} use [Leaflet.js](http://leafletjs.com) and support all the geometry types outlined in [the geoJSON spec](http://www.geojson.org/geojson-spec.html) (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TopoJSON files should be type "Topology" and adhere to the [topoJSON spec](https://github.com/mbostock/topojson/wiki/Specification). @@ -281,6 +287,12 @@ By default, the embedded map 420px x 620px, but you can customize the output by {% endtip %} +{% if mermaid %} +### Mapping in Markdown + +You can embed geoJSON and topoJSON directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps)." +{% endif %} + ### Clustering If your map contains a large number of markers (roughly over 750), GitHub will automatically cluster nearby markers at higher zoom levels. Simply click the cluster or zoom in to see individual markers. @@ -299,7 +311,7 @@ Additionally, if your `.geojson` file is especially large (over 10 MB), it is no It may still be possible to render the data by converting the `.geojson` file to [TopoJSON](https://github.com/mbostock/topojson), a compression format that, in some cases, can reduce filesize by up to 80%. Of course, you can always break the file into smaller chunks (such as by state or by year), and store the data as multiple files within the repository. -### Additional Resources +### Further reading * [Leaflet.js geojson documentation](http://leafletjs.com/examples/geojson.html) * [MapBox marker-styling documentation](http://www.mapbox.com/developers/simplestyle/) @@ -327,3 +339,45 @@ $ jupyter nbconvert --to html NOTEBOOK-NAME.ipynb - [Jupyter Notebook's GitHub repository](https://github.com/jupyter/jupyter_notebook) - [Gallery of Jupyter Notebooks](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks) + +{% if mermaid %} +## Displaying mermaid files on {% data variables.product.prodname_dotcom %} + +{% data variables.product.product_name %} supports rendering Mermaid files within repositories. Commit the file as you would normally using a `.mermaid` or `.mmd` extension. Then, navigate to the path of the Mermaid file on {% data variables.product.prodname_dotcom %}. + +For example, if you add a `.mmd` file with the following content to your repository: + +``` +graph TD + A[Friend's Birthday] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D["Cool
Laptop"] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] +``` + +When you view the file in the repository, it is rendered as a flow chart. +![Rendered mermaid file diagram](/assets/images/help/repository/mermaid-file-diagram.png) + +### Troubleshooting + +If your chart does not render at all, verify that it contains valid Mermaid Markdown syntax by checking your chart with the [Mermaid live editor](https://mermaid.live/edit). + +If the chart displays, but does not appear as you'd expect, you can create a new [feedback discussion](https://github.com/github/feedback/discussions/categories/general-feedback), and add the `mermaid` tag. + +#### Known issues + +* Sequence diagram charts frequently render with additional padding below the chart, with more padding added as the chart size increases. This is a known issue with the mMermaid library. +* Actor nodes with popover menus do not work as expected within sequence diagram charts. This is due to a discrepancy in how JavaScript events are added to a chart when the Mermaid library's API is used to render a chart. +* Not all charts are a11y compliant. This may affect users who rely on a screen reader. + +### Mermaid in Markdown + +You can embed Mermaid syntax directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams)." + +### Further reading + +* [Mermaid.js documentation](https://mermaid-js.github.io/mermaid/#/) +* [Mermaid.js live editor](https://mermaid.live/edit) +{% endif %} + diff --git a/content/rest/reference/deploy_keys.md b/content/rest/reference/deploy_keys.md new file mode 100644 index 000000000000..2a49dbdf4759 --- /dev/null +++ b/content/rest/reference/deploy_keys.md @@ -0,0 +1,17 @@ +--- +title: Deploy Keys +intro: 'The Deploy Keys API allows to create an SSH key that is stored on your server and grants access to a GitHub repository.' +allowTitleToDifferFromFilename: true +versions: + fpt: '*' + ghes: '*' + ghae: '*' + ghec: '*' +topics: + - API +miniTocMaxHeadingLevel: 3 +--- + + \ No newline at end of file diff --git a/content/rest/reference/deployments.md b/content/rest/reference/deployments.md index ebed155118f6..23d5e0a4ab6e 100644 --- a/content/rest/reference/deployments.md +++ b/content/rest/reference/deployments.md @@ -1,6 +1,6 @@ --- title: Deployments -intro: 'The deployments API allows you to create and delete deploy keys, deployments, and deployment environments.' +intro: 'The deployments API allows you to create and delete deployments and deployment environments.' allowTitleToDifferFromFilename: true versions: fpt: '*' diff --git a/content/rest/reference/index.md b/content/rest/reference/index.md index 91bdedf6b61a..f8af7f0e7aa4 100644 --- a/content/rest/reference/index.md +++ b/content/rest/reference/index.md @@ -22,6 +22,7 @@ children: - /collaborators - /commits - /dependabot + - /deploy_keys - /deployments - /emojis - /enterprise-admin diff --git a/data/features/mermaid.yml b/data/features/mermaid.yml index 7923730060fd..453320d1bf96 100644 --- a/data/features/mermaid.yml +++ b/data/features/mermaid.yml @@ -1,7 +1,7 @@ -# Issue 5812 and 6172 -# Mermaid syntax support +# Issues 5812 and 6172, also 6411 +# Mermaid syntax support, also ASCII STL and geoJSON/topoJSON syntax support versions: fpt: '*' ghec: '*' - ghes: '>=3.5' + ghes: '>=3.6' ghae: 'issue-6172' diff --git a/data/learning-tracks/code-security.yml b/data/learning-tracks/code-security.yml index a3953b368eda..c406f2337540 100644 --- a/data/learning-tracks/code-security.yml +++ b/data/learning-tracks/code-security.yml @@ -18,24 +18,24 @@ dependabot_alerts: title: 'Get notifications for vulnerable dependencies' description: 'Set up Dependabot to alert you to new vulnerabilities in your dependencies.' guides: - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies + - /code-security/dependabot/dependabot-alerts/about-dependabot-alerts - '{% ifversion fpt or ghec or ghes > 3.2 %}/github/administering-a-repository/managing-repository-settings/managing-security-and-analysis-settings-for-your-repository{% endif %}' - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors + - /code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts + - /code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts + - /code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates + - /code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies + - /code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors # Feature available on dotcom and GHES 3.3+, so articles available on GHAE and earlier GHES hidden to hide the learning track dependabot_security_updates: title: 'Get pull requests to update your vulnerable dependencies' description: 'Set up Dependabot to create pull requests when new vulnerabilities are reported.' guides: - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates + - /code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates + - /code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates - '{% ifversion fpt or ghec or ghes > 3.2 %}/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-notifications-for-vulnerable-dependencies{% endif %}' - '{% ifversion fpt or ghec or ghes > 3.2 %}/github/administering-a-repository/managing-repository-settings/managing-security-and-analysis-settings-for-your-repository{% endif %}' - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates + - /code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates - '{% ifversion fpt or ghec or ghes > 3.2 %}/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-the-detection-of-vulnerable-dependencies{% endif %}' # Feature available only on dotcom and GHES 3.3+ @@ -43,16 +43,16 @@ dependency_version_updates: title: 'Keep your dependencies up-to-date' description: 'Use Dependabot to check for new releases and create pull requests to update your dependencies.' guides: - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-dependabot-version-updates - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/listing-dependencies-configured-for-version-updates - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-encrypted-secrets-for-dependabot - - /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/managing-pull-requests-for-dependency-updates - - /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/troubleshooting-dependabot-errors + - /code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates + - /code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates + - /code-security/dependabot/dependabot-version-updates/customizing-dependency-updates + - /code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + - /code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot + - /code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions + - /code-security/dependabot/dependabot-version-updates/listing-dependencies-configured-for-version-updates + - /code-security/dependabot/working-with-dependabot/managing-encrypted-secrets-for-dependabot + - /code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates + - /code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors # Feature available in GHEC, GHES 3.0 up, and GHAE. Feature limited on FPT so hidden there. secret_scanning: diff --git a/data/reusables/code-scanning/alert-default-branch.md b/data/reusables/code-scanning/alert-default-branch.md new file mode 100644 index 000000000000..c6a6029e70d5 --- /dev/null +++ b/data/reusables/code-scanning/alert-default-branch.md @@ -0,0 +1 @@ +The status and details on the alert page only reflect the state of the alert on the default branch of the repository, even if the alert exists in other branches. You can see the status of the alert on non-default branches in the **Affected branches** section on the right-hand side of the alert page. If an alert doesn't exist in the default branch, the status of the alert will display as "in pull request" or "in branch" and will be colored grey. \ No newline at end of file diff --git a/data/reusables/code-scanning/filter-non-default-branches.md b/data/reusables/code-scanning/filter-non-default-branches.md new file mode 100644 index 000000000000..4df28a76d5b9 --- /dev/null +++ b/data/reusables/code-scanning/filter-non-default-branches.md @@ -0,0 +1 @@ +Please note that if you have filtered for alerts on a non-default branch, but the same alerts exist on the default branch, the alert page for any given alert will still only reflect the alert's status on the default branch, even if that status conflicts with the status on a non-default branch. For example, an alert that appears in the "Open" list in the summary of alerts for `branch-x` could show a status of "Fixed" on the alert page, if the alert is already fixed on the default branch. You can view the status of the alert for the branch you filtered on in the **Affected branches** section on the right side of the alert page. \ No newline at end of file diff --git a/data/reusables/dependabot/private-dependencies-note.md b/data/reusables/dependabot/private-dependencies-note.md index c3b22f451538..8b8c034cbc9d 100644 --- a/data/reusables/dependabot/private-dependencies-note.md +++ b/data/reusables/dependabot/private-dependencies-note.md @@ -1 +1 @@ -When running security or version updates, some ecosystems must be able to resolve all dependencies from their source to verify that updates have been successful. If your manifest or lock files contain any private dependencies, {% data variables.product.prodname_dependabot %} must be able to access the location at which those dependencies are hosted. Organization owners can grant {% data variables.product.prodname_dependabot %} access to private repositories containing dependencies for a project within the same organization. For more information, see "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization#allowing-dependabot-to-access-private-dependencies)." You can configure access to private registries in a repository's _dependabot.yml_ configuration file. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." +When running security or version updates, some ecosystems must be able to resolve all dependencies from their source to verify that updates have been successful. If your manifest or lock files contain any private dependencies, {% data variables.product.prodname_dependabot %} must be able to access the location at which those dependencies are hosted. Organization owners can grant {% data variables.product.prodname_dependabot %} access to private repositories containing dependencies for a project within the same organization. For more information, see "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization#allowing-dependabot-to-access-private-dependencies)." You can configure access to private registries in a repository's _dependabot.yml_ configuration file. For more information, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-private-registries)." diff --git a/data/reusables/dependabot/result-discrepancy.md b/data/reusables/dependabot/result-discrepancy.md new file mode 100644 index 000000000000..241548122bf2 --- /dev/null +++ b/data/reusables/dependabot/result-discrepancy.md @@ -0,0 +1 @@ +The results of dependency detection reported by {% data variables.product.product_name %} may be different from the results returned by other tools. There are good reasons for this and it's helpful to understand how {% data variables.product.prodname_dotcom %} determines dependencies for your project. diff --git a/data/reusables/repositories/github-reviews-security-advisories.md b/data/reusables/repositories/github-reviews-security-advisories.md index cf870a9e65d0..23dfa68dc7dc 100644 --- a/data/reusables/repositories/github-reviews-security-advisories.md +++ b/data/reusables/repositories/github-reviews-security-advisories.md @@ -1,3 +1,3 @@ {% data variables.product.prodname_dotcom %} will review each published security advisory, add it to the {% data variables.product.prodname_advisory_database %}, and may use the security advisory to send {% data variables.product.prodname_dependabot_alerts %} to affected repositories. If the security advisory comes from a fork, we'll only send an alert if the fork owns a package, published under a unique name, on a public package registry. This process can take up to 72 hours and {% data variables.product.prodname_dotcom %} may contact you for more information. -For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-dependabot-security-updates)." For more information about {% data variables.product.prodname_advisory_database %}, see "[Browsing security vulnerabilities in the {% data variables.product.prodname_advisory_database %}](/github/managing-security-vulnerabilities/browsing-security-vulnerabilities-in-the-github-advisory-database)." +For more information about {% data variables.product.prodname_dependabot_alerts %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-dependabot-security-updates)." For more information about {% data variables.product.prodname_advisory_database %}, see "[Browsing security vulnerabilities in the {% data variables.product.prodname_advisory_database %}](/github/managing-security-vulnerabilities/browsing-security-vulnerabilities-in-the-github-advisory-database)." diff --git a/data/reusables/repositories/security-alert-delivery-options.md b/data/reusables/repositories/security-alert-delivery-options.md index 35ab3f8fef9e..5c2d9404e40e 100644 --- a/data/reusables/repositories/security-alert-delivery-options.md +++ b/data/reusables/repositories/security-alert-delivery-options.md @@ -1,3 +1,3 @@ {% ifversion not ghae %} -If your repository has a supported dependency manifest{% ifversion fpt or ghec %} (and if you've set up the dependency graph if it's a private repository){% endif %}, whenever {% data variables.product.product_name %} detects a vulnerable dependency in your repository, you will receive a weekly digest email. You can also configure your security alerts as web notifications, individual email notifications, daily email digests, or alerts in the {% data variables.product.product_name %} interface. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." +If your repository has a supported dependency manifest{% ifversion fpt or ghec %} (and if you've set up the dependency graph if it's a private repository){% endif %}, whenever {% data variables.product.product_name %} detects a vulnerable dependency in your repository, you will receive a weekly digest email. You can also configure your security alerts as web notifications, individual email notifications, daily email digests, or alerts in the {% data variables.product.product_name %} interface. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." {% endif %} diff --git a/data/reusables/rest-reference/deployments/keys.md b/data/reusables/rest-reference/deploy_keys/deploy_keys.md similarity index 94% rename from data/reusables/rest-reference/deployments/keys.md rename to data/reusables/rest-reference/deploy_keys/deploy_keys.md index 52e0735aa4f5..008b8ba1330c 100644 --- a/data/reusables/rest-reference/deployments/keys.md +++ b/data/reusables/rest-reference/deploy_keys/deploy_keys.md @@ -1,5 +1,3 @@ -## Deploy keys - {% data reusables.repositories.deploy-keys %} Deploy keys can either be setup using the following API endpoints, or by using GitHub. To learn how to set deploy keys up in GitHub, see "[Managing deploy keys](/developers/overview/managing-deploy-keys)." \ No newline at end of file diff --git a/data/reusables/webhooks/repository_vulnerability_alert_short_desc.md b/data/reusables/webhooks/repository_vulnerability_alert_short_desc.md index bf2b01e473df..3dcba9b58d1e 100644 --- a/data/reusables/webhooks/repository_vulnerability_alert_short_desc.md +++ b/data/reusables/webhooks/repository_vulnerability_alert_short_desc.md @@ -1 +1 @@ -Activity related to security vulnerability alerts in a repository. {% data reusables.webhooks.action_type_desc %} For more information, see the "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)". +Activity related to security vulnerability alerts in a repository. {% data reusables.webhooks.action_type_desc %} For more information, see the "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)". diff --git a/lib/redirects/static/client-side-rest-api-redirects.json b/lib/redirects/static/client-side-rest-api-redirects.json index 66f496b36ace..8942c8e74c56 100644 --- a/lib/redirects/static/client-side-rest-api-redirects.json +++ b/lib/redirects/static/client-side-rest-api-redirects.json @@ -25,10 +25,16 @@ "/rest/reference/repos#list-repository-invitations": "/rest/reference/collaborators#list-repository-invitations", "/rest/reference/repos#update-a-repository-invitation": "/rest/reference/collaborators#update-a-repository-invitation", "/rest/reference/repos#delete-a-repository-invitation": "/rest/reference/collaborators#delete-a-repository-invitation", - "/rest/reference/repos#list-deploy-keys": "/rest/reference/deployments#list-deploy-keys", - "/rest/reference/repos#create-a-deploy-key": "/rest/reference/deployments#create-a-deploy-key", - "/rest/reference/repos#get-a-deploy-key": "/rest/reference/deployments#get-a-deploy-key", - "/rest/reference/repos#delete-a-deploy-key": "/rest/reference/deployments#delete-a-deploy-key", + "/rest/reference/repos#list-deploy-keys": "/rest/reference/deploy_keys#list-deploy-keys", + "/rest/reference/repos#create-a-deploy-key": "/rest/reference/deploy_keys#create-a-deploy-key", + "/rest/reference/repos#get-a-deploy-key": "/rest/reference/deploy_keys#get-a-deploy-key", + "/rest/reference/repos#delete-a-deploy-key": "/rest/reference/deploy_keys#delete-a-deploy-key", + "/rest/reference/repos#deploy-keys": "/rest/reference/deploy_keys", + "/rest/reference/deployments#list-deploy-keys": "/rest/reference/deploy_keys#list-deploy-keys", + "/rest/reference/deployments#create-a-deploy-key": "/rest/reference/deploy_keys#create-a-deploy-key", + "/rest/reference/deployments#get-a-deploy-key": "/rest/reference/deploy_keys#get-a-deploy-key", + "/rest/reference/deployments#delete-a-deploy-key": "/rest/reference/deploy_keys#delete-a-deploy-key", + "/rest/reference/deployments#deploy-keys": "/rest/reference/deploy_keys", "/rest/reference/repos#get-a-github-pages-site": "/rest/reference/pages#get-a-github-pages-site", "/rest/reference/repos#create-a-github-pages-site": "/rest/reference/pages#create-a-github-pages-site", "/rest/reference/repos#update-information-about-a-github-pages-site": "/rest/reference/pages#update-information-about-a-github-pages-site", diff --git a/lib/rest/static/apps/enabled-for-apps.json b/lib/rest/static/apps/enabled-for-apps.json index 3c04ea495941..2f66e77dc854 100644 --- a/lib/rest/static/apps/enabled-for-apps.json +++ b/lib/rest/static/apps/enabled-for-apps.json @@ -1133,6 +1133,28 @@ "requestPath": "/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -1188,26 +1210,6 @@ "slug": "delete-an-environment", "verb": "delete", "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ @@ -3968,6 +3970,28 @@ "requestPath": "/repos/{owner}/{repo}/statuses/{sha}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -4003,26 +4027,6 @@ "slug": "get-a-deployment-status", "verb": "get", "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ @@ -6471,6 +6475,28 @@ "requestPath": "/repos/{owner}/{repo}/statuses/{sha}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -6526,26 +6552,6 @@ "slug": "delete-an-environment", "verb": "delete", "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ @@ -9049,6 +9055,28 @@ "requestPath": "/repos/{owner}/{repo}/statuses/{sha}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -9104,26 +9132,6 @@ "slug": "delete-an-environment", "verb": "delete", "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ @@ -11791,6 +11799,28 @@ "requestPath": "/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -11846,26 +11876,6 @@ "slug": "delete-an-environment", "verb": "delete", "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ @@ -14320,6 +14330,28 @@ "requestPath": "/repos/{owner}/{repo}/statuses/{sha}" } ], + "deploy_keys": [ + { + "slug": "list-deploy-keys", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "create-a-deploy-key", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/keys" + }, + { + "slug": "get-a-deploy-key", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + }, + { + "slug": "delete-a-deploy-key", + "verb": "delete", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" + } + ], "deployments": [ { "slug": "list-deployments", @@ -14355,26 +14387,6 @@ "slug": "get-a-deployment-status", "verb": "get", "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" - }, - { - "slug": "list-deploy-keys", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "create-a-deploy-key", - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys" - }, - { - "slug": "get-a-deploy-key", - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" - }, - { - "slug": "delete-a-deploy-key", - "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}" } ], "emojis": [ diff --git a/lib/rest/static/decorated/api.github.com.json b/lib/rest/static/decorated/api.github.com.json index db99521dc104..795ddd5c20d7 100644 --- a/lib/rest/static/decorated/api.github.com.json +++ b/lib/rest/static/decorated/api.github.com.json @@ -37428,11 +37428,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -37452,51 +37452,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -37521,37 +37476,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -37575,14 +37530,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -37590,132 +37545,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -37723,29 +37588,19 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "422", @@ -37756,115 +37611,42 @@ "bodyParameters": [ { "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] - }, + } + ] + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "parameters": [ { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", - "in": "body", - "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", - "childParamsGroups": [] - } - ], - "subcategory": "deployments" - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { + "name": "owner", + "in": "path", + "required": true, + "schema": { "type": "string" }, "descriptionHTML": "" @@ -37879,34 +37661,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -37915,19 +37698,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -37948,61 +37730,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "environments": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -38021,42 +37795,107 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, + { + "name": "per_page", + "description": "Results per page (max 100)", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + }, + "descriptionHTML": "

Results per page (max 100)

" + }, + { + "name": "page", + "description": "Page number of the results to fetch.", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + }, + "descriptionHTML": "

Page number of the results to fetch.

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Get all environments", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "get-all-environments", + "slug": "list-deployments", "category": "deployments", - "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -38075,418 +37914,364 @@ "type": "string" }, "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Get an environment", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "environments" - }, - "slug": "get-an-environment", - "category": "deployments", - "subcategory": "environments", - "notes": [], - "bodyParameters": [], - "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" - } - ] - }, - { - "verb": "put", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" - } - ], - "summary": "Create or update an environment", + "summary": "Create a deployment", "requestBody": { - "required": false, + "required": true, "content": { "application/json": { "schema": { "type": "object", - "nullable": true, "properties": { - "wait_timer": { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", "childParamsGroups": [] }, - "reviewers": { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } + "type": "string" }, - "name": "reviewers", + "name": "required_contexts", "in": "body", "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] + "rawDescription": "The [status](https://docs.github.com/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] }, - "deployment_branch_policy": { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" ], - "name": "deployment_branch_policy", + "name": "payload", "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + "transient_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] } }, - "additionalProperties": false + "required": [ + "ref" + ] + }, + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } } } } - }, + }, + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "create-a-deployment", + "category": "deployments", + "notes": [], + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "responses": [ + { + "httpStatusCode": "201", + "httpStatusMessage": "Created", + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "bodyParameters": [ + { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] + } + ], + "subcategory": "deployments" + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "create-or-update-an-environment", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "environments", "notes": [], - "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "", + "bodyParameters": [], "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" } ], - "bodyParameters": [ - { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", - "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", - "childParamsGroups": [] - }, - { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } - }, - "name": "reviewers", - "in": "body", - "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] - }, - { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" - ], - "name": "deployment_branch_policy", - "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] - } - ] + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -38507,51 +38292,115 @@ "descriptionHTML": "" }, { - "name": "environment_name", + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Delete a deployment", + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "delete-a-deployment", + "category": "deployments", + "notes": [], + "bodyParameters": [], + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "responses": [ + { + "httpStatusCode": "204", + "httpStatusMessage": "No Content", + "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "subcategory": "deployments" + } + ], + "environments": [ + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/environments", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", "in": "path", "required": true, - "description": "The name of the environment", "schema": { "type": "string" }, - "descriptionHTML": "

The name of the environment

" + "descriptionHTML": "" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Delete an environment", + "summary": "Get all environments", "x-github": { "enabledForGitHubApps": true, "category": "repos", "subcategory": "environments" }, - "slug": "delete-an-environment", + "slug": "get-all-environments", "category": "deployments", "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { - "httpStatusCode": "204", - "httpStatusMessage": "No Content", - "description": "

Default response

" + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "

Response

", + "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" } ] - } - ], - "keys": [ + }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -38572,60 +38421,50 @@ "descriptionHTML": "" }, { - "name": "per_page", - "description": "Results per page (max 100)", - "in": "query", - "schema": { - "type": "integer", - "default": 30 - }, - "descriptionHTML": "

Results per page (max 100)

" - }, - { - "name": "page", - "description": "Page number of the results to fetch.", - "in": "query", + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", "schema": { - "type": "integer", - "default": 1 + "type": "string" }, - "descriptionHTML": "

Page number of the results to fetch.

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "List deploy keys", + "summary": "Get an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "list-deploy-keys", + "slug": "get-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" } ] }, { - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "verb": "put", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -38644,62 +38483,180 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" } ], - "summary": "Create a deploy key", + "summary": "Create or update an environment", "requestBody": { - "required": true, + "required": false, "content": { "application/json": { "schema": { "type": "object", + "nullable": true, "properties": { - "title": { - "type": "string", - "description": "

A name for the key.

", - "name": "title", + "wait_timer": { + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "reviewers": { + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } + }, + "name": "reviewers", "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, - "read_only": { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "deployment_branch_policy": { + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + }, + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", - "childParamsGroups": [] + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } }, - "required": [ - "key" - ] - }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "additionalProperties": false } } } @@ -38707,128 +38664,173 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "create-a-deploy-key", + "slug": "create-or-update-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { - "httpStatusCode": "201", - "httpStatusMessage": "Created", + "httpStatusCode": "200", + "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" }, { "httpStatusCode": "422", "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" + "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" } ], "bodyParameters": [ { - "type": "string", - "description": "

A name for the key.

", - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", - "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] - } - ] - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" }, { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } }, - "descriptionHTML": "" + "name": "reviewers", + "in": "body", + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, { - "name": "key_id", - "description": "key_id parameter", - "in": "path", - "required": true, - "schema": { - "type": "integer" + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } }, - "descriptionHTML": "

key_id parameter

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys/42" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" - } - ], - "summary": "Get a deploy key", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "keys" - }, - "slug": "get-a-deploy-key", - "category": "deployments", - "subcategory": "keys", - "notes": [], - "descriptionHTML": "", - "bodyParameters": [], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", + "in": "body", + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -38849,43 +38851,43 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "environment_name", "in": "path", "required": true, + "description": "The name of the environment", "schema": { - "type": "integer" + "type": "string" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", - "description": "

Response

" + "description": "

Default response

" } ] } diff --git a/lib/rest/static/decorated/ghes-3.1.json b/lib/rest/static/decorated/ghes-3.1.json index ca25f92fcd79..13802afa6438 100644 --- a/lib/rest/static/decorated/ghes-3.1.json +++ b/lib/rest/static/decorated/ghes-3.1.json @@ -29302,11 +29302,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -29326,51 +29326,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -29395,43 +29350,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -29455,14 +29404,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -29470,132 +29419,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.1/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -29603,148 +29462,59 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" - } - ], - "bodyParameters": [ - { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", - "in": "body", - "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.1/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", - "childParamsGroups": [] + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "bodyParameters": [ { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "type": "string", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } - ], - "subcategory": "deployments" + ] }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -29765,44 +29535,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "flash", - "html": "

New features in the Deployments API on GitHub are currently available during a public beta. Please see the blog post for full details.

\n

To access the new environment parameter, the two new values for the state parameter (in_progress and queued), and use auto_inactive on production deployments during the public beta period, you must provide the following custom media type in the Accept header:

\n
application/vnd.github.flash-preview+json
" - }, - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -29811,19 +29572,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -29844,61 +29604,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "keys": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -29918,6 +29670,51 @@ }, "descriptionHTML": "" }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, { "name": "per_page", "description": "Results per page (max 100)", @@ -29942,37 +29739,43 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deploy keys", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments", + "previews": [ + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "list-deploy-keys", + "slug": "list-deployments", "category": "deployments", - "subcategory": "keys", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -29996,14 +29799,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Create a deploy key", + "summary": "Create a deployment", "requestBody": { "required": true, "content": { @@ -30011,42 +29814,132 @@ "schema": { "type": "object", "properties": { - "title": { + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.1/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { "type": "string", - "description": "

A name for the key.

", - "name": "title", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", "in": "body", "rawType": "string", - "rawDescription": "A name for the key.", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", "in": "body", "rawType": "string", - "rawDescription": "The contents of the key.", + "rawDescription": "Short description of the deployment.", "childParamsGroups": [] }, - "read_only": { + "transient_environment": { "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "default": false, + "name": "transient_environment", "in": "body", "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", "childParamsGroups": [] } }, "required": [ - "key" + "ref" ] }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } } } } @@ -30054,19 +29947,35 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments", + "previews": [ + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "create-a-deploy-key", + "slug": "create-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" }, { "httpStatusCode": "422", @@ -30077,36 +29986,109 @@ "bodyParameters": [ { "type": "string", - "description": "

A name for the key.

", - "name": "title", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", "in": "body", "rawType": "string", - "rawDescription": "A name for the key.", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", "childParamsGroups": [] }, { "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", "in": "body", "rawType": "string", - "rawDescription": "The contents of the key.", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", "childParamsGroups": [] }, { "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", "in": "body", "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.1/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.1/rest/overview/api-previews#enhanced-deployments) custom media type.", "childParamsGroups": [] } - ] + ], + "subcategory": "deployments" }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -30127,35 +30109,44 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "deployment_id", + "description": "deployment_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

deployment_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" } ], - "summary": "Get a deploy key", + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments", + "previews": [ + { + "name": "flash", + "html": "

New features in the Deployments API on GitHub are currently available during a public beta. Please see the blog post for full details.

\n

To access the new environment parameter, the two new values for the state parameter (in_progress and queued), and use auto_inactive on production deployments during the public beta period, you must provide the following custom media type in the Accept header:

\n
application/vnd.github.flash-preview+json
" + }, + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "get-a-deploy-key", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -30164,18 +30155,19 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ] + ], + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -30196,45 +30188,55 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "deployment_id", + "description": "deployment_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

deployment_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" } - ] + ], + "subcategory": "deployments" } ], "statuses": [ diff --git a/lib/rest/static/decorated/ghes-3.2.json b/lib/rest/static/decorated/ghes-3.2.json index 72c8d41bf598..d1beb36532d9 100644 --- a/lib/rest/static/decorated/ghes-3.2.json +++ b/lib/rest/static/decorated/ghes-3.2.json @@ -30176,11 +30176,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -30200,51 +30200,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -30269,43 +30224,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -30329,14 +30278,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -30344,132 +30293,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.2/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -30477,35 +30336,19 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "422", @@ -30516,109 +30359,36 @@ "bodyParameters": [ { "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.2/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", - "in": "body", - "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", - "name": "production_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } - ], - "subcategory": "deployments" + ] }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -30639,44 +30409,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments", - "previews": [ - { - "name": "flash", - "html": "

New features in the Deployments API on GitHub are currently available during a public beta. Please see the blog post for full details.

\n

To access the new environment parameter, the two new values for the state parameter (in_progress and queued), and use auto_inactive on production deployments during the public beta period, you must provide the following custom media type in the Accept header:

\n
application/vnd.github.flash-preview+json
" - }, - { - "name": "ant-man", - "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" - } - ] + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -30685,19 +30446,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -30718,61 +30478,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "environments": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -30791,42 +30543,113 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, + { + "name": "per_page", + "description": "Results per page (max 100)", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + }, + "descriptionHTML": "

Results per page (max 100)

" + }, + { + "name": "page", + "description": "Page number of the results to fetch.", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + }, + "descriptionHTML": "

Page number of the results to fetch.

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Get all environments", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments", + "previews": [ + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "get-all-environments", + "slug": "list-deployments", "category": "deployments", - "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -30845,52 +30668,301 @@ "type": "string" }, "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Get an environment", - "x-github": { - "enabledForGitHubApps": true, + "summary": "Create a deployment", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.2/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + "transient_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + } + }, + "required": [ + "ref" + ] + }, + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } + } + } + } + }, + "x-github": { + "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments", + "previews": [ + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "get-an-environment", + "slug": "create-a-deployment", "category": "deployments", - "subcategory": "environments", "notes": [], - "bodyParameters": [], - "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", "responses": [ { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" + "httpStatusCode": "201", + "httpStatusMessage": "Created", + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" } - ] + ], + "bodyParameters": [ + { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.2/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.
\nNote: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. \n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.2/rest/overview/api-previews#enhanced-deployments) custom media type.", + "childParamsGroups": [] + } + ], + "subcategory": "deployments" }, { - "verb": "put", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -30911,352 +30983,65 @@ "descriptionHTML": "" }, { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" - } - ], - "summary": "Create or update an environment", - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "nullable": true, - "properties": { - "wait_timer": { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", - "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", - "childParamsGroups": [] - }, - "reviewers": { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } - }, - "name": "reviewers", - "in": "body", - "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] - }, - "deployment_branch_policy": { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" - ], - "name": "deployment_branch_policy", - "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] - } - }, - "additionalProperties": false - } - } + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" } - }, + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments", + "previews": [ + { + "name": "flash", + "html": "

New features in the Deployments API on GitHub are currently available during a public beta. Please see the blog post for full details.

\n

To access the new environment parameter, the two new values for the state parameter (in_progress and queued), and use auto_inactive on production deployments during the public beta period, you must provide the following custom media type in the Accept header:

\n
application/vnd.github.flash-preview+json
" + }, + { + "name": "ant-man", + "html": "

The inactive state and the log_url, environment_url, and auto_inactive parameters are currently available for developers to preview. Please see the blog post for full details.

\n

To access the API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.ant-man-preview+json
" + } + ] }, - "slug": "create-or-update-an-environment", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "environments", "notes": [], - "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "", + "bodyParameters": [], "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" } ], - "bodyParameters": [ - { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", - "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", - "childParamsGroups": [] - }, - { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } - }, - "name": "reviewers", - "in": "body", - "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] - }, - { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" - ], - "name": "deployment_branch_policy", - "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] - } - ] + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -31277,51 +31062,115 @@ "descriptionHTML": "" }, { - "name": "environment_name", + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Delete a deployment", + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "delete-a-deployment", + "category": "deployments", + "notes": [], + "bodyParameters": [], + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "responses": [ + { + "httpStatusCode": "204", + "httpStatusMessage": "No Content", + "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "subcategory": "deployments" + } + ], + "environments": [ + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/environments", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", "in": "path", "required": true, - "description": "The name of the environment", "schema": { "type": "string" }, - "descriptionHTML": "

The name of the environment

" + "descriptionHTML": "" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Delete an environment", + "summary": "Get all environments", "x-github": { "enabledForGitHubApps": true, "category": "repos", "subcategory": "environments" }, - "slug": "delete-an-environment", + "slug": "get-all-environments", "category": "deployments", "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { - "httpStatusCode": "204", - "httpStatusMessage": "No Content", - "description": "

Default response

" + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "

Response

", + "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" } ] - } - ], - "keys": [ + }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31342,60 +31191,50 @@ "descriptionHTML": "" }, { - "name": "per_page", - "description": "Results per page (max 100)", - "in": "query", - "schema": { - "type": "integer", - "default": 30 - }, - "descriptionHTML": "

Results per page (max 100)

" - }, - { - "name": "page", - "description": "Page number of the results to fetch.", - "in": "query", + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", "schema": { - "type": "integer", - "default": 1 + "type": "string" }, - "descriptionHTML": "

Page number of the results to fetch.

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "List deploy keys", + "summary": "Get an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "list-deploy-keys", + "slug": "get-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" } ] }, { - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "verb": "put", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31414,62 +31253,180 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" } ], - "summary": "Create a deploy key", + "summary": "Create or update an environment", "requestBody": { - "required": true, + "required": false, "content": { "application/json": { "schema": { "type": "object", + "nullable": true, "properties": { - "title": { - "type": "string", - "description": "

A name for the key.

", - "name": "title", + "wait_timer": { + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "reviewers": { + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } + }, + "name": "reviewers", "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, - "read_only": { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "deployment_branch_policy": { + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + }, + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", - "childParamsGroups": [] + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } }, - "required": [ - "key" - ] - }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "additionalProperties": false } } } @@ -31477,128 +31434,173 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "create-a-deploy-key", + "slug": "create-or-update-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { - "httpStatusCode": "201", - "httpStatusMessage": "Created", + "httpStatusCode": "200", + "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" }, { "httpStatusCode": "422", "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" + "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" } ], "bodyParameters": [ { - "type": "string", - "description": "

A name for the key.

", - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", - "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] - } - ] - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" }, { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } }, - "descriptionHTML": "" + "name": "reviewers", + "in": "body", + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, { - "name": "key_id", - "description": "key_id parameter", - "in": "path", - "required": true, - "schema": { - "type": "integer" + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } }, - "descriptionHTML": "

key_id parameter

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" - } - ], - "summary": "Get a deploy key", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "keys" - }, - "slug": "get-a-deploy-key", - "category": "deployments", - "subcategory": "keys", - "notes": [], - "descriptionHTML": "", - "bodyParameters": [], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", + "in": "body", + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31619,43 +31621,43 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "environment_name", "in": "path", "required": true, + "description": "The name of the environment", "schema": { - "type": "integer" + "type": "string" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", - "description": "

Response

" + "description": "

Default response

" } ] } diff --git a/lib/rest/static/decorated/ghes-3.3.json b/lib/rest/static/decorated/ghes-3.3.json index 550f77563a56..cabcc4ad29d9 100644 --- a/lib/rest/static/decorated/ghes-3.3.json +++ b/lib/rest/static/decorated/ghes-3.3.json @@ -30277,11 +30277,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -30301,51 +30301,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -30370,37 +30325,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -30424,14 +30379,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -30439,132 +30394,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.3/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -30572,29 +30437,19 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "422", @@ -30605,115 +30460,42 @@ "bodyParameters": [ { "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] - }, + } + ] + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "parameters": [ { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.3/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", - "in": "body", - "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", - "childParamsGroups": [] - } - ], - "subcategory": "deployments" - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { + "name": "owner", + "in": "path", + "required": true, + "schema": { "type": "string" }, "descriptionHTML": "" @@ -30728,34 +30510,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -30764,19 +30547,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -30797,61 +30579,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "environments": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -30870,42 +30644,107 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, + { + "name": "per_page", + "description": "Results per page (max 100)", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + }, + "descriptionHTML": "

Results per page (max 100)

" + }, + { + "name": "page", + "description": "Page number of the results to fetch.", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + }, + "descriptionHTML": "

Page number of the results to fetch.

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Get all environments", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "get-all-environments", + "slug": "list-deployments", "category": "deployments", - "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -30924,418 +30763,364 @@ "type": "string" }, "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Get an environment", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "environments" - }, - "slug": "get-an-environment", - "category": "deployments", - "subcategory": "environments", - "notes": [], - "bodyParameters": [], - "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" - } - ] - }, - { - "verb": "put", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" - } - ], - "summary": "Create or update an environment", + "summary": "Create a deployment", "requestBody": { - "required": false, + "required": true, "content": { "application/json": { "schema": { "type": "object", - "nullable": true, "properties": { - "wait_timer": { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", "childParamsGroups": [] }, - "reviewers": { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } + "type": "string" }, - "name": "reviewers", + "name": "required_contexts", "in": "body", "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.3/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] }, - "deployment_branch_policy": { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" ], - "name": "deployment_branch_policy", + "name": "payload", "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + "transient_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] } }, - "additionalProperties": false + "required": [ + "ref" + ] + }, + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } } } } - }, + }, + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "create-a-deployment", + "category": "deployments", + "notes": [], + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "responses": [ + { + "httpStatusCode": "201", + "httpStatusMessage": "Created", + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "bodyParameters": [ + { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.3/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] + } + ], + "subcategory": "deployments" + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "create-or-update-an-environment", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "environments", "notes": [], - "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "", + "bodyParameters": [], "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" } ], - "bodyParameters": [ - { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", - "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", - "childParamsGroups": [] - }, - { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } - }, - "name": "reviewers", - "in": "body", - "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] - }, - { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" - ], - "name": "deployment_branch_policy", - "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] - } - ] + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -31356,51 +31141,115 @@ "descriptionHTML": "" }, { - "name": "environment_name", + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Delete a deployment", + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "delete-a-deployment", + "category": "deployments", + "notes": [], + "bodyParameters": [], + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "responses": [ + { + "httpStatusCode": "204", + "httpStatusMessage": "No Content", + "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "subcategory": "deployments" + } + ], + "environments": [ + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/environments", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", "in": "path", "required": true, - "description": "The name of the environment", "schema": { "type": "string" }, - "descriptionHTML": "

The name of the environment

" + "descriptionHTML": "" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Delete an environment", + "summary": "Get all environments", "x-github": { "enabledForGitHubApps": true, "category": "repos", "subcategory": "environments" }, - "slug": "delete-an-environment", + "slug": "get-all-environments", "category": "deployments", "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { - "httpStatusCode": "204", - "httpStatusMessage": "No Content", - "description": "

Default response

" + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "

Response

", + "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" } ] - } - ], - "keys": [ + }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31421,60 +31270,50 @@ "descriptionHTML": "" }, { - "name": "per_page", - "description": "Results per page (max 100)", - "in": "query", - "schema": { - "type": "integer", - "default": 30 - }, - "descriptionHTML": "

Results per page (max 100)

" - }, - { - "name": "page", - "description": "Page number of the results to fetch.", - "in": "query", + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", "schema": { - "type": "integer", - "default": 1 + "type": "string" }, - "descriptionHTML": "

Page number of the results to fetch.

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "List deploy keys", + "summary": "Get an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "list-deploy-keys", + "slug": "get-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" } ] }, { - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "verb": "put", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31493,62 +31332,180 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" } ], - "summary": "Create a deploy key", + "summary": "Create or update an environment", "requestBody": { - "required": true, + "required": false, "content": { "application/json": { "schema": { "type": "object", + "nullable": true, "properties": { - "title": { - "type": "string", - "description": "

A name for the key.

", - "name": "title", + "wait_timer": { + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "reviewers": { + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } + }, + "name": "reviewers", "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, - "read_only": { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "deployment_branch_policy": { + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + }, + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", - "childParamsGroups": [] + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } }, - "required": [ - "key" - ] - }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "additionalProperties": false } } } @@ -31556,128 +31513,173 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "create-a-deploy-key", + "slug": "create-or-update-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { - "httpStatusCode": "201", - "httpStatusMessage": "Created", + "httpStatusCode": "200", + "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" }, { "httpStatusCode": "422", "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" + "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" } ], "bodyParameters": [ { - "type": "string", - "description": "

A name for the key.

", - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", - "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] - } - ] - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" }, { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } }, - "descriptionHTML": "" + "name": "reviewers", + "in": "body", + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, { - "name": "key_id", - "description": "key_id parameter", - "in": "path", - "required": true, - "schema": { - "type": "integer" + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } }, - "descriptionHTML": "

key_id parameter

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" - } - ], - "summary": "Get a deploy key", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "keys" - }, - "slug": "get-a-deploy-key", - "category": "deployments", - "subcategory": "keys", - "notes": [], - "descriptionHTML": "", - "bodyParameters": [], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", + "in": "body", + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -31698,43 +31700,43 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "environment_name", "in": "path", "required": true, + "description": "The name of the environment", "schema": { - "type": "integer" + "type": "string" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", - "description": "

Response

" + "description": "

Default response

" } ] } diff --git a/lib/rest/static/decorated/ghes-3.4.json b/lib/rest/static/decorated/ghes-3.4.json index a4ddddd69bde..80959f32c393 100644 --- a/lib/rest/static/decorated/ghes-3.4.json +++ b/lib/rest/static/decorated/ghes-3.4.json @@ -32841,11 +32841,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -32865,51 +32865,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -32934,37 +32889,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -32988,14 +32943,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -33003,132 +32958,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.4/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -33136,29 +33001,19 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "422", @@ -33169,115 +33024,42 @@ "bodyParameters": [ { "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] - }, + } + ] + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "parameters": [ { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.4/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", - "in": "body", - "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", - "childParamsGroups": [] - } - ], - "subcategory": "deployments" - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { + "name": "owner", + "in": "path", + "required": true, + "schema": { "type": "string" }, "descriptionHTML": "" @@ -33292,34 +33074,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -33328,19 +33111,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -33361,61 +33143,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "environments": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -33434,42 +33208,107 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, + { + "name": "per_page", + "description": "Results per page (max 100)", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + }, + "descriptionHTML": "

Results per page (max 100)

" + }, + { + "name": "page", + "description": "Page number of the results to fetch.", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + }, + "descriptionHTML": "

Page number of the results to fetch.

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Get all environments", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "get-all-environments", + "slug": "list-deployments", "category": "deployments", - "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -33488,418 +33327,364 @@ "type": "string" }, "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Get an environment", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "environments" - }, - "slug": "get-an-environment", - "category": "deployments", - "subcategory": "environments", - "notes": [], - "bodyParameters": [], - "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" - } - ] - }, - { - "verb": "put", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" - }, - { - "name": "environment_name", - "in": "path", - "required": true, - "description": "The name of the environment", - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the environment

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" - } - ], - "summary": "Create or update an environment", + "summary": "Create a deployment", "requestBody": { - "required": false, + "required": true, "content": { "application/json": { "schema": { "type": "object", - "nullable": true, "properties": { - "wait_timer": { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", "childParamsGroups": [] }, - "reviewers": { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } + "type": "string" }, - "name": "reviewers", + "name": "required_contexts", "in": "body", "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.4/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] }, - "deployment_branch_policy": { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" ], - "name": "deployment_branch_policy", + "name": "payload", "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + "transient_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] } }, - "additionalProperties": false + "required": [ + "ref" + ] + }, + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } } } } - }, + }, + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "create-a-deployment", + "category": "deployments", + "notes": [], + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "responses": [ + { + "httpStatusCode": "201", + "httpStatusMessage": "Created", + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "bodyParameters": [ + { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/enterprise-server@3.4/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "childParamsGroups": [] + } + ], + "subcategory": "deployments" + }, + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "environments" + "subcategory": "deployments" }, - "slug": "create-or-update-an-environment", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "environments", "notes": [], - "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "", + "bodyParameters": [], "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" } ], - "bodyParameters": [ - { - "type": "integer", - "example": 30, - "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", - "name": "wait_timer", - "in": "body", - "rawType": "integer", - "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", - "childParamsGroups": [] - }, - { - "type": "array of objects or null", - "nullable": true, - "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - "id": { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - } - }, - "name": "reviewers", - "in": "body", - "rawType": "array", - "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", - "childParamsGroups": [ - { - "parentName": "reviewers", - "parentType": "items", - "id": "reviewers-items", - "params": [ - { - "type": "string", - "description": "

The type of reviewer. Must be one of: User or Team

", - "enum": [ - "User", - "Team" - ], - "example": "User", - "name": "type", - "in": "body", - "rawType": "string", - "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", - "childParamsGroups": [] - }, - { - "type": "integer", - "description": "

The id of the user or team who can review the deployment

", - "example": 4532992, - "name": "id", - "in": "body", - "rawType": "integer", - "rawDescription": "The id of the user or team who can review the deployment", - "childParamsGroups": [] - } - ] - } - ] - }, - { - "type": "object or null", - "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", - "properties": { - "protected_branches": { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - "custom_branch_policies": { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - }, - "nullable": true, - "required": [ - "protected_branches", - "custom_branch_policies" - ], - "name": "deployment_branch_policy", - "in": "body", - "rawType": "object", - "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", - "childParamsGroups": [ - { - "parentName": "deployment_branch_policy", - "parentType": "object", - "id": "deployment_branch_policy-object", - "params": [ - { - "type": "boolean", - "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", - "name": "protected_branches", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", - "name": "custom_branch_policies", - "in": "body", - "rawType": "boolean", - "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", - "childParamsGroups": [] - } - ] - } - ] - } - ] + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -33920,51 +33705,115 @@ "descriptionHTML": "" }, { - "name": "environment_name", + "name": "deployment_id", + "description": "deployment_id parameter", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

deployment_id parameter

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + } + ], + "summary": "Delete a deployment", + "x-github": { + "enabledForGitHubApps": true, + "category": "repos", + "subcategory": "deployments" + }, + "slug": "delete-a-deployment", + "category": "deployments", + "notes": [], + "bodyParameters": [], + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "responses": [ + { + "httpStatusCode": "204", + "httpStatusMessage": "No Content", + "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" + } + ], + "subcategory": "deployments" + } + ], + "environments": [ + { + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/environments", + "parameters": [ + { + "name": "owner", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "" + }, + { + "name": "repo", "in": "path", "required": true, - "description": "The name of the environment", "schema": { "type": "string" }, - "descriptionHTML": "

The name of the environment

" + "descriptionHTML": "" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "Delete an environment", + "summary": "Get all environments", "x-github": { "enabledForGitHubApps": true, "category": "repos", "subcategory": "environments" }, - "slug": "delete-an-environment", + "slug": "get-all-environments", "category": "deployments", "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", + "descriptionHTML": "

Get all environments for a repository.

\n

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { - "httpStatusCode": "204", - "httpStatusMessage": "No Content", - "description": "

Default response

" + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "

Response

", + "payload": "{\n \"total_count\": 1,\n \"environments\": [\n {\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n }\n ]\n}" } ] - } - ], - "keys": [ + }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -33985,60 +33834,50 @@ "descriptionHTML": "" }, { - "name": "per_page", - "description": "Results per page (max 100)", - "in": "query", - "schema": { - "type": "integer", - "default": 30 - }, - "descriptionHTML": "

Results per page (max 100)

" - }, - { - "name": "page", - "description": "Page number of the results to fetch.", - "in": "query", + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", "schema": { - "type": "integer", - "default": 1 + "type": "string" }, - "descriptionHTML": "

Page number of the results to fetch.

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "List deploy keys", + "summary": "Get an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "list-deploy-keys", + "slug": "get-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" } ] }, { - "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "verb": "put", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -34057,62 +33896,180 @@ "type": "string" }, "descriptionHTML": "" + }, + { + "name": "environment_name", + "in": "path", + "required": true, + "description": "The name of the environment", + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X PUT \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME \\\n -d '{\"wait_timer\":42}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('PUT /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name',\n wait_timer: 42\n})" } ], - "summary": "Create a deploy key", + "summary": "Create or update an environment", "requestBody": { - "required": true, + "required": false, "content": { "application/json": { "schema": { "type": "object", + "nullable": true, "properties": { - "title": { - "type": "string", - "description": "

A name for the key.

", - "name": "title", + "wait_timer": { + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "reviewers": { + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } + }, + "name": "reviewers", "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, - "read_only": { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "deployment_branch_policy": { + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + }, + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", - "childParamsGroups": [] + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } }, - "required": [ - "key" - ] - }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "additionalProperties": false } } } @@ -34120,128 +34077,173 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "create-a-deploy-key", + "slug": "create-or-update-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"Environments.\"

\n

Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"Environments.\"

\n

Note: To create or update secrets for an environment, see \"Secrets.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { - "httpStatusCode": "201", - "httpStatusMessage": "Created", + "httpStatusCode": "200", + "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"id\": 161088068,\n \"node_id\": \"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\",\n \"name\": \"staging\",\n \"url\": \"https://api.github.com/repos/github/hello-world/environments/staging\",\n \"html_url\": \"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\",\n \"created_at\": \"2020-11-23T22:00:40Z\",\n \"updated_at\": \"2020-11-23T22:00:40Z\",\n \"protection_rules\": [\n {\n \"id\": 3736,\n \"node_id\": \"MDQ6R2F0ZTM3MzY=\",\n \"type\": \"wait_timer\",\n \"wait_timer\": 30\n },\n {\n \"id\": 3755,\n \"node_id\": \"MDQ6R2F0ZTM3NTU=\",\n \"type\": \"required_reviewers\",\n \"reviewers\": [\n {\n \"type\": \"User\",\n \"reviewer\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n },\n {\n \"type\": \"Team\",\n \"reviewer\": {\n \"id\": 1,\n \"node_id\": \"MDQ6VGVhbTE=\",\n \"url\": \"https://api.github.com/teams/1\",\n \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n \"name\": \"Justice League\",\n \"slug\": \"justice-league\",\n \"description\": \"A great team.\",\n \"privacy\": \"closed\",\n \"permission\": \"admin\",\n \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n \"parent\": null\n }\n }\n ]\n },\n {\n \"id\": 3756,\n \"node_id\": \"MDQ6R2F0ZTM3NTY=\",\n \"type\": \"branch_policy\"\n }\n ],\n \"deployment_branch_policy\": {\n \"protected_branches\": false,\n \"custom_branch_policies\": true\n }\n}" }, { "httpStatusCode": "422", "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" + "description": "

Validation error when the environment name is invalid or when protected_branches and custom_branch_policies in deployment_branch_policy are set to the same value

" } ], "bodyParameters": [ { - "type": "string", - "description": "

A name for the key.

", - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "A name for the key.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", - "in": "body", - "rawType": "string", - "rawDescription": "The contents of the key.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "type": "integer", + "example": 30, + "description": "

The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).

", + "name": "wait_timer", "in": "body", - "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawType": "integer", + "rawDescription": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).", "childParamsGroups": [] - } - ] - }, - { - "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", - "parameters": [ - { - "name": "owner", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "" }, { - "name": "repo", - "in": "path", - "required": true, - "schema": { - "type": "string" + "type": "array of objects or null", + "nullable": true, + "description": "

The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.

", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + "id": { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + } }, - "descriptionHTML": "" + "name": "reviewers", + "in": "body", + "rawType": "array", + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", + "childParamsGroups": [ + { + "parentName": "reviewers", + "parentType": "items", + "id": "reviewers-items", + "params": [ + { + "type": "string", + "description": "

The type of reviewer. Must be one of: User or Team

", + "enum": [ + "User", + "Team" + ], + "example": "User", + "name": "type", + "in": "body", + "rawType": "string", + "rawDescription": "The type of reviewer. Must be one of: `User` or `Team`", + "childParamsGroups": [] + }, + { + "type": "integer", + "description": "

The id of the user or team who can review the deployment

", + "example": 4532992, + "name": "id", + "in": "body", + "rawType": "integer", + "rawDescription": "The id of the user or team who can review the deployment", + "childParamsGroups": [] + } + ] + } + ] }, { - "name": "key_id", - "description": "key_id parameter", - "in": "path", - "required": true, - "schema": { - "type": "integer" + "type": "object or null", + "description": "

The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.

", + "properties": { + "protected_branches": { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + "custom_branch_policies": { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } }, - "descriptionHTML": "

key_id parameter

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" - } - ], - "summary": "Get a deploy key", - "x-github": { - "enabledForGitHubApps": true, - "category": "repos", - "subcategory": "keys" - }, - "slug": "get-a-deploy-key", - "category": "deployments", - "subcategory": "keys", - "notes": [], - "descriptionHTML": "", - "bodyParameters": [], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" + "nullable": true, + "required": [ + "protected_branches", + "custom_branch_policies" + ], + "name": "deployment_branch_policy", + "in": "body", + "rawType": "object", + "rawDescription": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.", + "childParamsGroups": [ + { + "parentName": "deployment_branch_policy", + "parentType": "object", + "id": "deployment_branch_policy-object", + "params": [ + { + "type": "boolean", + "description": "

Required. Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.

", + "name": "protected_branches", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Required. Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.

", + "name": "custom_branch_policies", + "in": "body", + "rawType": "boolean", + "rawDescription": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.", + "childParamsGroups": [] + } + ] + } + ] } ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", "parameters": [ { "name": "owner", @@ -34262,43 +34264,43 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "environment_name", "in": "path", "required": true, + "description": "The name of the environment", "schema": { - "type": "integer" + "type": "string" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

The name of the environment

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/environments/ENVIRONMENT_NAME" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete an environment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "environments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-an-environment", "category": "deployments", - "subcategory": "keys", + "subcategory": "environments", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

You must authenticate using an access token with the repo scope to use this endpoint.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", - "description": "

Response

" + "description": "

Default response

" } ] } diff --git a/lib/rest/static/decorated/github.ae.json b/lib/rest/static/decorated/github.ae.json index e57069b546e6..f8cb4c449ea5 100644 --- a/lib/rest/static/decorated/github.ae.json +++ b/lib/rest/static/decorated/github.ae.json @@ -26912,11 +26912,11 @@ } ] }, - "deployments": { - "deployments": [ + "deploy_keys": { + "deploy_keys": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -26936,51 +26936,6 @@ }, "descriptionHTML": "" }, - { - "name": "sha", - "description": "The SHA recorded at creation time.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The SHA recorded at creation time.

" - }, - { - "name": "ref", - "description": "The name of the ref. This can be a branch, tag, or SHA.", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" - }, - { - "name": "task", - "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none" - }, - "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" - }, - { - "name": "environment", - "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "none", - "nullable": true - }, - "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" - }, { "name": "per_page", "description": "Results per page (max 100)", @@ -27005,37 +26960,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deployments", + "summary": "List deploy keys", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "list-deployments", - "category": "deployments", + "slug": "list-deploy-keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], + "descriptionHTML": "", "bodyParameters": [], - "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" + "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" } - ], - "subcategory": "deployments" + ] }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/deployments", + "requestPath": "/repos/{owner}/{repo}/keys", "parameters": [ { "name": "owner", @@ -27059,14 +27014,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" } ], - "summary": "Create a deployment", + "summary": "Create a deploy key", "requestBody": { "required": true, "content": { @@ -27074,132 +27029,42 @@ "schema": { "type": "object", "properties": { - "ref": { - "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - "task": { + "title": { "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - "auto_merge": { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - "required_contexts": { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/github-ae@latest/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - "payload": { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, - "environment": { + "key": { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - "description": { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - "transient_environment": { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, - "production_environment": { + "read_only": { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } }, "required": [ - "ref" + "key" ] }, - "examples": { - "simple-example": { - "summary": "Simple example", - "value": { - "ref": "topic-branch", - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot" - } - }, - "advanced-example": { - "summary": "Advanced example", - "value": { - "ref": "topic-branch", - "auto_merge": false, - "payload": "{ \"deploy\": \"migrate\" }", - "description": "Deploy request from hubot", - "required_contexts": [ - "ci/janky", - "security/brakeman" - ] - } - } + "example": { + "title": "octocat@octomac", + "key": "ssh-rsa AAA...", + "read_only": true } } } @@ -27207,29 +27072,19 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "create-a-deployment", - "category": "deployments", + "slug": "create-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], - "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub AE we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", + "descriptionHTML": "

You can create a read-only deploy key.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "Simple example", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" - }, - { - "httpStatusCode": "202", - "httpStatusMessage": "Accepted", - "description": "

Merged branch response

", - "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" - }, - { - "httpStatusCode": "409", - "httpStatusMessage": "Conflict", - "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" + "description": "

Response

", + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "422", @@ -27240,109 +27095,36 @@ "bodyParameters": [ { "type": "string", - "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", - "name": "ref", - "in": "body", - "rawType": "string", - "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", - "childParamsGroups": [] - }, - { - "type": "string", - "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", - "default": "deploy", - "name": "task", + "description": "

A name for the key.

", + "name": "title", "in": "body", "rawType": "string", - "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", - "default": true, - "name": "auto_merge", - "in": "body", - "rawType": "boolean", - "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", - "childParamsGroups": [] - }, - { - "type": "array of strings", - "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", - "items": { - "type": "string" - }, - "name": "required_contexts", - "in": "body", - "rawType": "array", - "rawDescription": "The [status](https://docs.github.com/github-ae@latest/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", - "childParamsGroups": [] - }, - { - "oneOf": [ - { - "type": "object", - "additionalProperties": true - }, - { - "type": "string", - "description": "JSON payload with extra information about the deployment.", - "default": "" - } - ], - "name": "payload", - "in": "body", - "type": "object or string or ", - "description": "

JSON payload with extra information about the deployment.

", + "rawDescription": "A name for the key.", "childParamsGroups": [] }, { "type": "string", - "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", - "default": "production", - "name": "environment", - "in": "body", - "rawType": "string", - "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", - "childParamsGroups": [] - }, - { - "type": "string or null", - "description": "

Short description of the deployment.

", - "default": "", - "nullable": true, - "name": "description", + "description": "

Required. The contents of the key.

", + "name": "key", "in": "body", "rawType": "string", - "rawDescription": "Short description of the deployment.", - "childParamsGroups": [] - }, - { - "type": "boolean", - "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", - "default": false, - "name": "transient_environment", - "in": "body", - "rawType": "boolean", - "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "rawDescription": "The contents of the key.", "childParamsGroups": [] }, { "type": "boolean", - "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", - "name": "production_environment", + "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", + "name": "read_only", "in": "body", "rawType": "boolean", - "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", + "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", "childParamsGroups": [] } - ], - "subcategory": "deployments" + ] }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -27363,34 +27145,35 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Get a deployment", + "summary": "Get a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "get-a-deployment", - "category": "deployments", + "slug": "get-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -27399,19 +27182,18 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ], - "subcategory": "deployments" + ] }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", + "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", "parameters": [ { "name": "owner", @@ -27432,61 +27214,53 @@ "descriptionHTML": "" }, { - "name": "deployment_id", - "description": "deployment_id parameter", + "name": "key_id", + "description": "key_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

deployment_id parameter

" + "descriptionHTML": "

key_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" } ], - "summary": "Delete a deployment", + "summary": "Delete a deploy key", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "deployments" + "subcategory": "keys" }, - "slug": "delete-a-deployment", - "category": "deployments", + "slug": "delete-a-deploy-key", + "category": "deploy_keys", + "subcategory": "deploy_keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "

Resource not found

" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "

Validation failed

" } - ], - "subcategory": "deployments" + ] } - ], - "keys": [ + ] + }, + "deployments": { + "deployments": [ { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -27506,6 +27280,51 @@ }, "descriptionHTML": "" }, + { + "name": "sha", + "description": "The SHA recorded at creation time.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The SHA recorded at creation time.

" + }, + { + "name": "ref", + "description": "The name of the ref. This can be a branch, tag, or SHA.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the ref. This can be a branch, tag, or SHA.

" + }, + { + "name": "task", + "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none" + }, + "descriptionHTML": "

The name of the task for the deployment (e.g., deploy or deploy:migrations).

" + }, + { + "name": "environment", + "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "none", + "nullable": true + }, + "descriptionHTML": "

The name of the environment that was deployed to (e.g., staging or production).

" + }, { "name": "per_page", "description": "Results per page (max 100)", @@ -27530,37 +27349,37 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world'\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], - "summary": "List deploy keys", + "summary": "List deployments", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments" }, - "slug": "list-deploy-keys", + "slug": "list-deployments", "category": "deployments", - "subcategory": "keys", "notes": [], - "descriptionHTML": "", "bodyParameters": [], + "descriptionHTML": "

Simple filtering of deployments is available via query parameters:

", "responses": [ { "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "[\n {\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n }\n]" + "payload": "[\n {\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n }\n]" } - ] + ], + "subcategory": "deployments" }, { "verb": "post", - "requestPath": "/repos/{owner}/{repo}/keys", + "requestPath": "/repos/{owner}/{repo}/deployments", "parameters": [ { "name": "owner", @@ -27584,14 +27403,14 @@ "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys \\\n -d '{\"key\":\"key\"}'" + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments \\\n -d '{\"ref\":\"ref\"}'" }, { "lang": "JavaScript", - "source": "await octokit.request('POST /repos/{owner}/{repo}/keys', {\n owner: 'octocat',\n repo: 'hello-world',\n key: 'key'\n})" + "source": "await octokit.request('POST /repos/{owner}/{repo}/deployments', {\n owner: 'octocat',\n repo: 'hello-world',\n ref: 'ref'\n})" } ], - "summary": "Create a deploy key", + "summary": "Create a deployment", "requestBody": { "required": true, "content": { @@ -27599,42 +27418,132 @@ "schema": { "type": "object", "properties": { - "title": { + "ref": { + "type": "string", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", + "in": "body", + "rawType": "string", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", + "childParamsGroups": [] + }, + "task": { + "type": "string", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", + "in": "body", + "rawType": "string", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", + "childParamsGroups": [] + }, + "auto_merge": { + "type": "boolean", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", + "in": "body", + "rawType": "boolean", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + "required_contexts": { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/github-ae@latest/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + "payload": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + "environment": { "type": "string", - "description": "

A name for the key.

", - "name": "title", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", "in": "body", "rawType": "string", - "rawDescription": "A name for the key.", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", "childParamsGroups": [] }, - "key": { - "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "description": { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", "in": "body", "rawType": "string", - "rawDescription": "The contents of the key.", + "rawDescription": "Short description of the deployment.", "childParamsGroups": [] }, - "read_only": { + "transient_environment": { "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", "in": "body", "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + "production_environment": { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", "childParamsGroups": [] } }, "required": [ - "key" + "ref" ] }, - "example": { - "title": "octocat@octomac", - "key": "ssh-rsa AAA...", - "read_only": true + "examples": { + "simple-example": { + "summary": "Simple example", + "value": { + "ref": "topic-branch", + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot" + } + }, + "advanced-example": { + "summary": "Advanced example", + "value": { + "ref": "topic-branch", + "auto_merge": false, + "payload": "{ \"deploy\": \"migrate\" }", + "description": "Deploy request from hubot", + "required_contexts": [ + "ci/janky", + "security/brakeman" + ] + } + } } } } @@ -27642,19 +27551,29 @@ "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments" }, - "slug": "create-a-deploy-key", + "slug": "create-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], - "descriptionHTML": "

You can create a read-only deploy key.

", + "descriptionHTML": "

Deployments offer a few configurable parameters with certain defaults.

\n

The ref parameter can be any named branch, tag, or SHA. At GitHub AE we often deploy branches and verify them\nbefore we merge a pull request.

\n

The environment parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as production, staging, and qa. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is production.

\n

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.

\n

By default, commit statuses for every submitted context must be in a success\nstate. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.

\n

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.

\n

The task parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.

\n

Users with repo or repo_deployment scopes can create a deployment for a given ref.

\n

Merged branch response

\n

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:

\n
    \n
  • Auto-merge option is enabled in the repository
  • \n
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • \n
  • There are no merge conflicts
  • \n
\n

If there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.

\n

Merge conflict response

\n

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't\nbe merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

\n

Failed commit status checks

\n

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of success.

", "responses": [ { "httpStatusCode": "201", "httpStatusMessage": "Created", - "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "description": "Simple example", + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" + }, + { + "httpStatusCode": "202", + "httpStatusMessage": "Accepted", + "description": "

Merged branch response

", + "payload": "{\n \"message\": \"Auto-merged master into topic-branch on deployment.\"\n}" + }, + { + "httpStatusCode": "409", + "httpStatusMessage": "Conflict", + "description": "

Conflict when there is a merge conflict or the commit's status checks failed

" }, { "httpStatusCode": "422", @@ -27665,36 +27584,109 @@ "bodyParameters": [ { "type": "string", - "description": "

A name for the key.

", - "name": "title", + "description": "

Required. The ref to deploy. This can be a branch, tag, or SHA.

", + "name": "ref", "in": "body", "rawType": "string", - "rawDescription": "A name for the key.", + "rawDescription": "The ref to deploy. This can be a branch, tag, or SHA.", "childParamsGroups": [] }, { "type": "string", - "description": "

Required. The contents of the key.

", - "name": "key", + "description": "

Specifies a task to execute (e.g., deploy or deploy:migrations).

", + "default": "deploy", + "name": "task", "in": "body", "rawType": "string", - "rawDescription": "The contents of the key.", + "rawDescription": "Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).", "childParamsGroups": [] }, { "type": "boolean", - "description": "

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

\n

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"Repository permission levels for an organization\" and \"Permission levels for a user account repository.\"

", - "name": "read_only", + "description": "

Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.

", + "default": true, + "name": "auto_merge", "in": "body", "rawType": "boolean", - "rawDescription": "If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. \n \nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"", + "rawDescription": "Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.", + "childParamsGroups": [] + }, + { + "type": "array of strings", + "description": "

The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.

", + "items": { + "type": "string" + }, + "name": "required_contexts", + "in": "body", + "rawType": "array", + "rawDescription": "The [status](https://docs.github.com/github-ae@latest/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.", + "childParamsGroups": [] + }, + { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "string", + "description": "JSON payload with extra information about the deployment.", + "default": "" + } + ], + "name": "payload", + "in": "body", + "type": "object or string or ", + "description": "

JSON payload with extra information about the deployment.

", + "childParamsGroups": [] + }, + { + "type": "string", + "description": "

Name for the target deployment environment (e.g., production, staging, qa).

", + "default": "production", + "name": "environment", + "in": "body", + "rawType": "string", + "rawDescription": "Name for the target deployment environment (e.g., `production`, `staging`, `qa`).", + "childParamsGroups": [] + }, + { + "type": "string or null", + "description": "

Short description of the deployment.

", + "default": "", + "nullable": true, + "name": "description", + "in": "body", + "rawType": "string", + "rawDescription": "Short description of the deployment.", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false

", + "default": false, + "name": "transient_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`", + "childParamsGroups": [] + }, + { + "type": "boolean", + "description": "

Specifies if the given environment is one that end-users directly interact with. Default: true when environment is production and false otherwise.

", + "name": "production_environment", + "in": "body", + "rawType": "boolean", + "rawDescription": "Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.", "childParamsGroups": [] } - ] + ], + "subcategory": "deployments" }, { "verb": "get", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -27715,35 +27707,34 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "deployment_id", + "description": "deployment_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

deployment_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" }, { "lang": "JavaScript", - "source": "await octokit.request('GET /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('GET /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" } ], - "summary": "Get a deploy key", + "summary": "Get a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments" }, - "slug": "get-a-deploy-key", + "slug": "get-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], "descriptionHTML": "", "bodyParameters": [], @@ -27752,18 +27743,19 @@ "httpStatusCode": "200", "httpStatusMessage": "OK", "description": "

Response

", - "payload": "{\n \"id\": 1,\n \"key\": \"ssh-rsa AAA...\",\n \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n \"title\": \"octocat@octomac\",\n \"verified\": true,\n \"created_at\": \"2014-12-10T15:53:42Z\",\n \"read_only\": true\n}" + "payload": "{\n \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n \"id\": 1,\n \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n \"ref\": \"topic-branch\",\n \"task\": \"deploy\",\n \"payload\": {},\n \"original_environment\": \"staging\",\n \"environment\": \"production\",\n \"description\": \"Deploy request from hubot\",\n \"creator\": {\n \"login\": \"octocat\",\n \"id\": 1,\n \"node_id\": \"MDQ6VXNlcjE=\",\n \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/octocat\",\n \"html_url\": \"https://github.com/octocat\",\n \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n },\n \"created_at\": \"2012-07-20T01:19:13Z\",\n \"updated_at\": \"2012-07-20T01:19:13Z\",\n \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n \"transient_environment\": false,\n \"production_environment\": true\n}" }, { "httpStatusCode": "404", "httpStatusMessage": "Not Found", "description": "

Resource not found

" } - ] + ], + "subcategory": "deployments" }, { "verb": "delete", - "requestPath": "/repos/{owner}/{repo}/keys/{key_id}", + "requestPath": "/repos/{owner}/{repo}/deployments/{deployment_id}", "parameters": [ { "name": "owner", @@ -27784,45 +27776,55 @@ "descriptionHTML": "" }, { - "name": "key_id", - "description": "key_id parameter", + "name": "deployment_id", + "description": "deployment_id parameter", "in": "path", "required": true, "schema": { "type": "integer" }, - "descriptionHTML": "

key_id parameter

" + "descriptionHTML": "

deployment_id parameter

" } ], "x-codeSamples": [ { "lang": "Shell", - "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/keys/42" + "source": "curl \\\n -X DELETE \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://{hostname}/api/v3/repos/octocat/hello-world/deployments/42" }, { "lang": "JavaScript", - "source": "await octokit.request('DELETE /repos/{owner}/{repo}/keys/{key_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n key_id: 42\n})" + "source": "await octokit.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', {\n owner: 'octocat',\n repo: 'hello-world',\n deployment_id: 42\n})" } ], - "summary": "Delete a deploy key", + "summary": "Delete a deployment", "x-github": { "enabledForGitHubApps": true, "category": "repos", - "subcategory": "keys" + "subcategory": "deployments" }, - "slug": "delete-a-deploy-key", + "slug": "delete-a-deployment", "category": "deployments", - "subcategory": "keys", "notes": [], "bodyParameters": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", + "descriptionHTML": "

If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo or repo_deployment scopes can delete a deployment.

\n

To set a deployment as inactive, you must:

\n
    \n
  • Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
  • \n
  • Mark the active deployment as inactive by adding any non-successful deployment status.
  • \n
\n

For more information, see \"Create a deployment\" and \"Create a deployment status.\"

", "responses": [ { "httpStatusCode": "204", "httpStatusMessage": "No Content", "description": "

Response

" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "

Validation failed

" } - ] + ], + "subcategory": "deployments" } ], "statuses": [ diff --git a/script/rest/update-files.js b/script/rest/update-files.js index 2833791bbe3a..1a819e46b5d9 100755 --- a/script/rest/update-files.js +++ b/script/rest/update-files.js @@ -140,10 +140,15 @@ async function updateRedirectOverrides() { const redirects = {} console.log('\n➡️ Updating REST API redirect exception list.\n') - for (const value of Object.values(overrides)) { + for (const [key, value] of Object.entries(overrides)) { const oldUrl = value.originalUrl const anchor = oldUrl.replace('/rest/reference', '').split('#')[1] - redirects[oldUrl] = `/rest/reference/${value.category}#${anchor}` + if (key.includes('#')) { + // We are updating a subcategory into a category + redirects[oldUrl] = `/rest/reference/${value.category}` + } else { + redirects[oldUrl] = `/rest/reference/${value.category}#${anchor}` + } } await writeFile( 'lib/redirects/static/client-side-rest-api-redirects.json', diff --git a/script/rest/utils/rest-api-overrides.json b/script/rest/utils/rest-api-overrides.json index b94d33c10837..13e312dcebcd 100644 --- a/script/rest/utils/rest-api-overrides.json +++ b/script/rest/utils/rest-api-overrides.json @@ -130,25 +130,55 @@ "originalUrl": "/rest/reference/repos#delete-a-repository-invitation" }, "repos/list-deploy-keys": { - "category": "deployments", - "subcategory": "keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "originalUrl": "/rest/reference/repos#list-deploy-keys" }, "repos/create-deploy-key": { - "category": "deployments", - "subcategory": "keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "originalUrl": "/rest/reference/repos#create-a-deploy-key" }, "repos/get-deploy-key": { - "category": "deployments", - "subcategory": "keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "originalUrl": "/rest/reference/repos#get-a-deploy-key" }, "repos/delete-deploy-key": { - "category": "deployments", - "subcategory": "keys", + "category": "deploy_keys", + "subcategory": "deploy_keys", "originalUrl": "/rest/reference/repos#delete-a-deploy-key" }, + "repos#deploy-keys": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/repos#deploy-keys" + }, + "deployments/list-deploy-keys": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/deployments#list-deploy-keys" + }, + "deployments/create-deploy-key": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/deployments#create-a-deploy-key" + }, + "deployments/get-deploy-key": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/deployments#get-a-deploy-key" + }, + "deployments/delete-deploy-key": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/deployments#delete-a-deploy-key" + }, + "deployments#deploy-keys": { + "category": "deploy_keys", + "subcategory": "deploy_keys", + "originalUrl": "/rest/reference/deployments#deploy-keys" + }, "repos/get-pages": { "category": "pages", "subcategory": null,