1
0
mirror of synced 2026-01-29 03:03:52 -05:00

Merge branch 'main' into updates-1480-terraform-registries

This commit is contained in:
mc
2021-06-01 07:45:45 +01:00
committed by GitHub
119 changed files with 5151 additions and 4780 deletions

View File

@@ -39,7 +39,7 @@ export const SidebarProduct = () => {
const isStandaloneCategory = childPage.page.documentType === 'article'
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive = routePath.includes(routePath)
const isActive = routePath.includes(childPage.href)
const isCurrent = routePath === childPage.href
return (
<li

View File

@@ -20,7 +20,7 @@ topics:
Subdomain isolation mitigates cross-site scripting and other related vulnerabilities. For more information, see "[Cross-site scripting](http://en.wikipedia.org/wiki/Cross-site_scripting)" on Wikipedia. We highly recommend that you enable subdomain isolation on {% data variables.product.product_location %}.
When subdomain isolation is enabled, {% data variables.product.prodname_ghe_server %} replaces several paths with subdomains.
When subdomain isolation is enabled, {% data variables.product.prodname_ghe_server %} replaces several paths with subdomains. After enabling subdomain isolation, attempts to access the previous paths for some user-supplied content, such as `http(s)://HOSTNAME/raw/`, may return `404` errors.
{% if currentVersion == "enterprise-server@2.22" %}
To use Docker with {% data variables.product.prodname_registry %}, you must also enable subdomain isolation. For more information, see "[Working with the Docker registry](/enterprise/{{ currentVersion }}/user/packages/working-with-a-github-packages-registry/working-with-the-docker-registry)."

View File

@@ -22,7 +22,7 @@ featuredLinks:
- '{% if currentVersion == "github-ae@latest" %}/admin/user-management/customizing-user-messages-for-your-enterprise{% endif %}'
- '{% if currentVersion == "github-ae@latest" %}/admin/github-actions/getting-started-with-github-actions-for-github-ae{% endif %}'
popular:
- '{% if currentVersion == "github-ae@latest" %}/admin/overview/github-ae-release-notes{% endif %}'
- '{% if currentVersion == "github-ae@latest" %}/admin/release-notes{% endif %}'
- '{% if enterpriseServerVersions contains currentVersion %}/github/getting-started-with-github/setting-up-a-trial-of-github-enterprise-server{% endif %}'
- '{% if enterpriseServerVersions contains currentVersion %}/admin/installation{% endif %}'
- '{% if currentVersion == "github-ae@latest" %}/admin/authentication/configuring-authentication-and-provisioning-for-your-enterprise-using-azure-ad{% endif %}'
@@ -50,14 +50,3 @@ children:
- /release-notes
- /all-releases
---
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->
<!-- . -->

View File

@@ -45,5 +45,5 @@ To upgrade your enterprise to a new release, see "[Release notes](/enterprise-se
- [ {% data variables.product.prodname_roadmap %} ]( {% data variables.product.prodname_roadmap_link %} ) in the `github/roadmap` repository
{% if currentVersion == "github-ae@latest" %}
- [ {% data variables.product.prodname_ghe_managed %} release notes](/admin/overview/github-ae-release-notes)
- [ {% data variables.product.prodname_ghe_managed %} release notes](/admin/release-notes)
{% endif %}

View File

@@ -1,89 +0,0 @@
---
title: GitHub AE release notes
intro: March 1, 2021
versions:
github-ae: '*'
---
### Features
#### {% data variables.product.prodname_actions %} beta
[{% data variables.product.prodname_actions %}](https://github.com/features/actions) is a powerful, flexible solution for CI/CD and workflow automation. For more information, see "[Introduction to {% data variables.product.prodname_actions %}](/actions/learn-github-actions/introduction-to-github-actions)."
{% data variables.product.prodname_actions %} on {% data variables.product.product_name %} uses a new [{% data variables.actions.hosted_runner %}](/actions/using-github-hosted-runners/about-ae-hosted-runners), only available for {% data variables.product.product_name %}, that enables you to customize the size, image, and networking configuration of the runners. These runners are a finished-service CI compute environment with auto-scaling and management, fully managed by {% data variables.product.company_short %}. During the beta, the use {% data variables.actions.hosted_runner %}s is free of charge. For more information, see "[Adding {% data variables.actions.hosted_runner %}s](/actions/using-github-hosted-runners/adding-ae-hosted-runners)."
Please note that when {% data variables.product.prodname_actions %} is enabled during this upgrade, two organizations named "GitHub Actions" (@**actions** and @**github**) will appear in {% data variables.product.product_location %}. These organizations are required by {% data variables.product.prodname_actions %}. Users named @**ghost** and @**actions** appear as the actors for creation of these organizations in the audit log.
#### {% data variables.product.prodname_registry %} beta
[{% data variables.product.prodname_registry %}](https://github.com/features/packages) is a package hosting service, natively integrated with {% data variables.product.prodname_actions %}, APIs, and webhooks. Create an [end-to-end DevOps workflow](/github-ae@latest/packages/quickstart) that includes your code, continuous integration, and deployment solutions. For more information, see "[About {% data variables.product.prodname_registry %}](/packages/learn-github-packages/about-github-packages)."
During this beta, {% data variables.product.prodname_registry %} is free of charge to {% data variables.product.product_name %} customers.
#### {% data variables.product.prodname_GH_advanced_security %} beta
{% data variables.product.prodname_GH_advanced_security %} is available in beta and includes both {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_secret_scanning %}. Repository administrators and organization owners can opt into {% data variables.product.prodname_advanced_security %} features in the settings for a repository or organization, within the **Security and analysis** tab. For more information, see "[About {% data variables.product.prodname_GH_advanced_security %}](/github/getting-started-with-github/about-github-advanced-security)."
During this beta, {% data variables.product.prodname_advanced_security %} features are free of charge to {% data variables.product.product_name %} customers.
#### Manage teams from your identity provider (IdP)
Customers using SCIM (System for Cross-domain Identity Management) can now sync security groups in Azure Active Directory with {% data variables.product.company_short %} teams. Once a team has been linked to a security group, membership will be automatically updated in {% data variables.product.product_name %} when a user is added or removed from their assigned security group. For more information, see "[Synchronizing a team with an identity provider group](/organizations/organizing-members-into-teams/synchronizing-a-team-with-an-identity-provider-group)."
#### IP allow lists beta
Enterprise and organization owners can now use IP allow lists to restrict traffic to the enterprise or specific organizations. After you configure an IP allow list, only visitors from IP addresses on the list are permitted to access the resources protected by the list.
This functionality is provided in addition to the ability to request network security group changes that filter traffic to the entirety of the {% data variables.product.product_name %} tenant.
For more information, see "[Restricting network traffic to your enterprise](/admin/configuration/restricting-network-traffic-to-your-enterprise)" and "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization)."
#### Pull request auto-merge
With auto-merge, pull requests can be set to merge automatically when all merge requirements have been satisfied. This saves users from needing to constantly check the state of their pull requests just to merge them. Auto-merge can be enabled by a user with permission to merge and on pull requests that have unsatisfied merge requirements (like missing approvals or pending or failing required status checks). For more information, see "[Automatically merging a pull request](/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request)."
### Changes
#### Developer changes
- [Organization owners can now disable publication](/organizations/managing-organization-settings/managing-the-publication-of-github-pages-sites-for-your-organization) of {% data variables.product.prodname_pages %} sites from repositories in the organization. This will not unpublish existing sites.
- Repositories that use {% data variables.product.prodname_pages %} can now [build and deploy from any branch](/pages/getting-started-with-github-pages/about-github-pages#publishing-sources-for-github-pages-sites).
- When writing an issue or pull request, the list syntax for bullets, numbers, and tasks will now be autocompleted after you press `return` or `enter`.
- You can now delete a directory in a repository from the repository page. When navigating to a directory, a new kebab button next to the "Add file" button gives the option to delete the directory.
- Its now easier and faster to [reference issues or pull requests](/github/writing-on-github/basic-writing-and-formatting-syntax#referencing-issues-and-pull-requests), with search across multiple words after the "#".
##### Administration changes
- Enterprise owners can now [publish a mandatory message](/admin/user-management/customizing-user-messages-for-your-enterprise#creating-a-mandatory-message). The message is shown to all users and they must acknowledge it. This can be used to display important information, terms of service or policies.
- The {% data variables.product.prodname_github_app%} single file path permission can now [support up to ten files](/developers/apps/creating-a-github-app-using-url-parameters).
- When configuring a {% data variables.product.prodname_github_app%}, the authorization callback URL is a required field. Now we will permit the integrator to specify multiple callback URLs. {% data variables.product.product_name %} denies authorization if the callback URL from the request is not listed.
- A [new API endpoint](/rest/reference/apps#create-a-scoped-access-token) enables the exchange of a user to server token for a user to server token scoped to specific repositories.
- Events are now logged in the audit log on [promoting a team member to be a team maintainer and on demoting a team maintainer to be a team member](/admin/user-management/audited-actions#teams).
- The [OAuth device authorization flow](/developers/apps/authorizing-oauth-apps#device-flow) is now supported. This allows any CLI client or developer tool to authenticate using a secondary system.
- A user can no longer delete their account if SCIM provisioning is enabled.
##### Default branch renaming
Enterprise and organization owners can now set the default branch name for new repositories. Enterprise owners can also enforce their choice of default branch name across all organizations or allow individual organizations to choose their own. For more information, see "[Enforcing repository management policies in your enterprise](/admin/policies/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-on-the-default-branch-name)" and "[Managing the default branch name for repositories in your organization](/organizations/managing-organization-settings/managing-the-default-branch-name-for-repositories-in-your-organization)."
Existing repositories are unaffected by these settings, and their default branch name will not be changed.
This change is one of many changes {% data variables.product.company_short %} is making to support projects and maintainers that want to rename their default branch. To learn more, see [github/renaming](https://github.com/github/renaming).
### Bug fixes
- Users can no longer set a backup email address on their profile. Their email address is set through the IdP only.
- You can no longer enable two-factor authentication after configuring authentication through your IdP.
- {% data variables.product.product_name %} can now connect to Azure Boards.
- Version headers were missing from the APIs, and have now been set to "GitHub AE."
- Links to documentation have been fixed.
- Configuration of audit log forwarding within the enterprise's settings was failing.
- Navigating to gists could result in a 500 error.
- The Support email or URL was failing to save. It now saves after a period of a few minutes.
- Organization level pull request templates were not being applied to all pull requests in the organization.
### Known issues
- Geographic location data is not shown in the audit log. Location information can otherwise be discerned from the IP address associated with each event.
- The link to {% data variables.product.prodname_registry %} from a repository page shows an incorrect search page when that repository does not have any packages.

View File

@@ -8,6 +8,7 @@ versions:
github-ae: '*'
children:
- /about-github-ae
- /about-upgrades-to-new-releases
- /about-data-residency
- /about-enterprise-accounts
- /managing-your-github-enterprise-license
@@ -15,6 +16,5 @@ children:
- /about-upgrades-to-new-releases
- /system-overview
- /about-the-github-enterprise-api
- /github-ae-release-notes
---
For more information, or to purchase {% data variables.product.prodname_enterprise %}, see [{% data variables.product.prodname_enterprise %}](https://github.com/enterprise).

View File

@@ -1,11 +1,12 @@
---
title: Release notes
intro: 'The release notes for {{ allVersions[currentVersion].versionTitle }}.'
layout: release-notes
versions:
enterprise-server: '*'
github-ae: '*'
topics:
- Enterprise
- Upgrades
redirect_from:
- /admin/overview/github-ae-release-notes
---

View File

@@ -49,9 +49,9 @@ We strongly discourage force pushing, since this changes the history of your rep
**Changing the message of the most recently pushed commit**
1. Follow the [steps above](/articles/changing-a-commit-message#commit-has-not-been-pushed-online) to amend the commit message.
2. Use the `push --force` command to force push over the old commit.
2. Use the `push --force-with-lease` command to force push over the old commit.
```shell
$ git push --force <em>example-branch</em>
$ git push --force-with-lease <em>example-branch</em>
```
**Changing the message of older or multiple commit messages**

View File

@@ -369,4 +369,4 @@ Name | Type | Description
``hub.mode``|`string` | **Required**. Either `subscribe` or `unsubscribe`.
``hub.topic``|`string` |**Required**. The URI of the GitHub repository to subscribe to. The path must be in the format of `/{owner}/{repo}/events/{event}`.
``hub.callback``|`string` | The URI to receive the updates to the topic.
``hub.secret``|`string` | A shared secret key that generates a SHA1 HMAC of the outgoing body content. You can verify a push came from GitHub by comparing the raw request body with the contents of the `X-Hub-Signature` header. You can see [the PubSubHubbub documentation](https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#authednotify) for more details.
``hub.secret``|`string` | A shared secret key that generates a hash signature of the outgoing body content. You can verify a push came from GitHub by comparing the raw request body with the contents of the {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`X-Hub-Signature` or `X-Hub-Signature-256` headers{% elsif currentVersion ver_lt "enterprise-server@2.23" %}`X-Hub-Signature` header{% elsif currentVersion == "github-ae@latest" %}`X-Hub-Signature-256` header{% endif %}. You can see [the PubSubHubbub documentation](https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#authednotify) for more details.

View File

@@ -18,6 +18,11 @@ sections:
Administrators using {% data variables.product.prodname_GH_advanced_security %} can [enable and configure](/enterprise-server@3.1/admin/configuration/configuring-secret-scanning-for-your-appliance) {% data variables.product.prodname_GH_advanced_security %} secret scanning. You can review the [updated minimum requirements for your platform](/enterprise-server@3.1/admin/installation/setting-up-a-github-enterprise-server-instance) before you turn on {% data variables.product.prodname_GH_advanced_security %} secret scanning.
- heading: GitHub Advanced Security Code Scanning
notes:
- |
[{% data variables.product.prodname_GH_advanced_security %} code scanning](https://github.com/features/security) is now generally available on {% data variables.product.prodname_ghe_server %} 3.1+. Organizations who have purchased {% data variables.product.prodname_GH_advanced_security %} can use this capability to do static analysis security testing against their code, and prevent vulnerabilities from making it to their production code using CodeQL, our semantic analysis engine. For more information, see "[Configuring code scanning on your appliance](/en/enterprise-server@3.1/admin/configuration/configuring-code-scanning-for-your-appliance#running-code-scanning-using-github-actions)."
- heading: GitHub Advanced Security billing improvements
notes:
- |

View File

@@ -0,0 +1,37 @@
# Release notes for GitHub Enterprise Server
Rendered here: https://docs.github.com/en/enterprise-server@latest/admin/release-notes
## How it works
### Placeholder content file
A content file exists in `content/admin/release-notes.md`. It has a special frontmatter property `layout: release-notes` and no Markdown content. The source of the release notes comes from YAML data.
### YAML source
The source data for the release notes lives in this directory (`data/release-notes/enterprise-server`).
The directories are named by GHES release number (with a hyphen instead of a period).
The YAML files in each directory are named by patch number. Some patch filenames may end with `-rc<num>.yml`, which means it's a release candidate. A release candidate file also requires `release_candidate: true` in the YAML data.
Release notes of deprecated GHES versions (see `lib/enterprise-server-releases.js`) are **not** removed from the site and will always be displayed alongside currently supported versions.
Note that patch files can be deprecated individually (i.e., hidden on the docs site) by an optional `deprecated: true` property.
### Middleware processing
The YAML data is processed and sorted by `middleware/contextualizers/release-notes.js` and added to the `context` object.
### Layouts
The `context` object data is rendered by `layouts/release-notes.html` and `includes/enterprise-server-release-notes.html`.
The release notes page has a custom design with CSS in `stylesheets/release-notes.scss` and client-side JavaScript in `javascripts/release-notes.js`.
### Schema
The schema that validates the YAML data lives in `tests/helpers/schemas/ghes-release-notes-schema.js`. See the schema file to find out the required and optional properties.
The schema is exercised by a test in `tests/linting/lint-files.js`. The test will fail if the data does not pass validation.

View File

@@ -0,0 +1,83 @@
date: '2021-03-03'
friendlyDate: 'March 3, 2021'
title: 'Week of March 3, 2021'
currentWeek: false
sections:
features:
- heading: 'GitHub Actions beta'
notes:
- |
[{% data variables.product.prodname_actions %}](https://github.com/features/actions) is a powerful, flexible solution for CI/CD and workflow automation. For more information, see "[Introduction to {% data variables.product.prodname_actions %}](/actions/learn-github-actions/introduction-to-github-actions)."
{% data variables.product.prodname_actions %} on {% data variables.product.product_name %} uses a new [{% data variables.actions.hosted_runner %}](/actions/using-github-hosted-runners/about-ae-hosted-runners), only available for {% data variables.product.product_name %}, that enables you to customize the size, image, and networking configuration of the runners. These runners are a finished-service CI compute environment with auto-scaling and management, fully managed by {% data variables.product.company_short %}. During the beta, the use {% data variables.actions.hosted_runner %}s is free of charge. For more information, see "[Adding {% data variables.actions.hosted_runner %}s](/actions/using-github-hosted-runners/adding-ae-hosted-runners)."
Please note that when {% data variables.product.prodname_actions %} is enabled during this upgrade, two organizations named "GitHub Actions" (@**actions** and @**github**) will appear in {% data variables.product.product_location %}. These organizations are required by {% data variables.product.prodname_actions %}. Users named @**ghost** and @**actions** appear as the actors for creation of these organizations in the audit log.
- heading: 'GitHub Packages beta'
notes:
- |
[{% data variables.product.prodname_registry %}](https://github.com/features/packages) is a package hosting service, natively integrated with {% data variables.product.prodname_actions %}, APIs, and webhooks. Create an [end-to-end DevOps workflow](/github-ae@latest/packages/quickstart) that includes your code, continuous integration, and deployment solutions. During this beta, {% data variables.product.prodname_registry %} is offered free of charge to {% data variables.product.product_name %} customers.
- heading: 'GitHub Advanced Security beta'
notes:
- |
{% data variables.product.prodname_GH_advanced_security %} is available in beta and includes both code scanning and secret scanning. During this beta, {% data variables.product.prodname_GH_advanced_security %} features are being offered free of charge to {% data variables.product.product_name %} customers. Repository and organization administrators can opt-in to use {% data variables.product.prodname_GH_advanced_security %} in the Security and Analysis tab under settings.
Learn more about {% data variables.product.prodname_GH_advanced_security %} [code scanning](/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning) and [secret scanning](/github/administering-a-repository/about-secret-scanning) on {% data variables.product.prodname_ghe_managed %}.
- heading: Manage teams from your identity provider (IdP)
notes:
- |
Customers using SCIM (System for Cross-domain Identity Management) can now sync security groups in Azure Active Directory with {% data variables.product.company_short %} teams. Once a team has been linked to a security group, membership will be automatically updated in {% data variables.product.product_name %} when a user is added or removed from their assigned security group.
- heading: IP allow lists beta
notes:
- |
[{% data variables.product.company_short %} IP allow lists](/admin/configuration/restricting-network-traffic-to-your-enterprise) provide the ability to filter traffic from administrator-specified IP ranges, defined by CIDR notation. The allow list is defined at the enterprise or organization account level in Security > Settings. All traffic that attempts to reach resources within the enterprise account and organizations are filtered by the IP allow lists. This functionality is provided in addition to the ability to request network security group changes that filter traffic to the entirety of the GHAE tenant.
changes:
- heading: Developer Changes
notes:
- |
[Organization owners can now disable publication](/github/setting-up-and-managing-organizations-and-teams/managing-the-publication-of-github-pages-sites-for-your-organization) of {% data variables.product.prodname_pages %} sites from repositories in the organization. This will not unpublish existing sites.
- Repositories that use {% data variables.product.prodname_pages %} can now [build and deploy from any branch](/github/working-with-github-pages/about-github-pages#publishing-sources-for-github-pages-sites).
- When writing an issue or pull request, the list syntax for bullets, numbers, and tasks will now be autocompleted after you press `return` or `enter`.
- You can now delete a directory in a repository from the repository page. When navigating to a directory, a new kebab button next to the "Add file" button gives the option to delete the directory.
- It's now easier and faster to [reference issues or pull requests](/github/writing-on-github/basic-writing-and-formatting-syntax#referencing-issues-and-pull-requests), with search across multiple words after the "#".
- heading: Administration changes
notes:
- Enterprise owners can now publish a mandatory message. The message is shown to all users and they must acknowledge it. This can be used to display important information, terms of service or policies.
- The {% data variables.product.prodname_github_app%} single file path permission can now [support up to ten files](/developers/apps/creating-a-github-app-using-url-parameters).
- When configuring a {% data variables.product.prodname_github_app%}, the authorization callback URL is a required field. Now we will permit the integrator to specify multiple callback URLs. {% data variables.product.product_name %} denies authorization if the callback URL from the request is not listed.
- A [new API endpoint](/rest/reference/apps#create-a-scoped-access-token) enables the exchange of a user to server token for a user to server token scoped to specific repositories.
- Events are now logged in the audit log on [promoting a team member to be a team maintainer and on demoting a team maintainer to be a team member](/admin/user-management/audited-actions#teams).
- The [OAuth device authorization flow](/developers/apps/authorizing-oauth-apps#device-flow) is now supported. This allows any CLI client or developer tool to authenticate using a secondary system.
- A user can no longer delete their account if SCIM provisioning is enabled.
- heading: Default branch renaming
notes:
- |
Enterprise and organization owners can now set the default branch name for new repositories. Enterprise owners can also enforce their choice of default branch name across all organizations or allow individual organizations to choose their own.
Existing repositories are unaffected by these settings, and their default branch name will not be changed.
This change is one of many changes {% data variables.product.company_short %} is making to support projects and maintainers that want to rename their default branch. To learn more, see [github/renaming](https://github.com/github/renaming).
bugs:
- heading: Bug fixes
notes:
- Users can no longer set a backup email address on their profile. Their email address is set through the IdP only.
- You can no longer enable two-factor authentication after configuring authentication through your IdP.
- |
{% data variables.product.product_name %} can now connect to Azure Boards.
- Version headers were missing from the APIs, and have now been set to "GitHub AE."
- Links to documentation have been fixed.
- Configuration of audit log forwarding within the enterprise's settings was failing.
- Navigating to gists could result in a 500 error.
- The Support email or URL was failing to save. It now saves after a period of a few minutes.
- Organization level pull request templates were not being applied to all pull requests in the organization.
known_issues:
- heading: Known issues
notes:
- Geographic location data is not shown in the audit log. Location information can otherwise be discerned from the IP address associated with each event.
- The link to {% data variables.product.prodname_registry %} from a repository page shows an incorrect search page when that repository does not have any packages.

View File

@@ -0,0 +1,35 @@
# Release notes for GitHub AE
Rendered here: https://docs.github.com/en/github-ae@latest/admin/release-notes
## How it works
### Placeholder content file
A content file exists in `content/admin/release-notes.md`. It has a special frontmatter property `layout: release-notes` and no Markdown content. The source of the release notes comes from YAML data.
### YAML source
The source data for the release notes lives in this directory (`data/release-notes/github-ae`).
The directories are named by month. The YAML files are named by the data of a weekly release.
A boolean property called `currentWeek` must be set in each YAML file. No more than one file at a time can have this property set to true.
Note that patch files can be deprecated individually (i.e., hidden on the docs site) by an optional `deprecated: true` property.
### Middleware processing
The YAML data is processed and sorted by `middleware/contextualizers/release-notes.js` and added to the `context` object.
### Layouts
The `context` object data is rendered by `layouts/release-notes.html` and `includes/github-ae-release-notes.html`.
The release notes page has a custom design with CSS in `stylesheets/release-notes.scss` and client-side JavaScript in `javascripts/release-notes.js`.
### Schema
The schema that validates the YAML data lives in `tests/helpers/schemas/ghae-release-notes-schema.js`. See the schema file to find out the required and optional properties.
The schema is exercised by a test in `tests/linting/lint-files.js`. The test will fail if the data does not pass validation.

View File

@@ -1 +1 @@
Setting a webhook secret allows you to ensure that `POST` requests sent to the payload URL are from {% data variables.product.product_name %}. When you set a secret, you'll receive the {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}`X-Hub-Signature` and `X-Hub-Signature-256` headers{% elsif currentVersion ver_lt "enterprise-server@2.23" %}`X-Hub-Signature` header{% elsif currentVersion == "github-ae@latest" %}`X-Hub-Signature-256` header{% endif %} in the webhook `POST` request. For more information on how to use a secret with a signature header to secure your webhook payloads, see "[Securing your webhooks](/webhooks/securing/)."
Setting a webhook secret allows you to ensure that `POST` requests sent to the payload URL are from {% data variables.product.product_name %}. When you set a secret, you'll receive the {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}`X-Hub-Signature` and `X-Hub-Signature-256` headers{% elsif currentVersion ver_lt "enterprise-server@2.23" %}`X-Hub-Signature` header{% elsif currentVersion == "github-ae@latest" %}`X-Hub-Signature-256` header{% endif %} in the webhook `POST` request. For more information on how to use a secret with a signature header to secure your webhook payloads, see "[Securing your webhooks](/webhooks/securing/)."

View File

@@ -18,10 +18,14 @@ header:
please visit our
<a id="to-english-doc" href="/en">English documentation</a>.
early_access: 📣 Please <b>do not share</b> this URL publicly. This page contains content about an early access feature.
ghes_release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
ghes_release_notes_upgrade_patch_only: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of Enterprise Server. {% data ui.header.notices.ghes_release_notes_use_latest %}
ghes_release_notes_upgrade_release_only: 📣 This is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server. {% data ui.header.notices.ghes_release_notes_use_latest %}
ghes_release_notes_upgrade_patch_and_release: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of this release series, and this is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server. {% data ui.header.notices.ghes_release_notes_use_latest %}
release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
# GHES release notes
ghes_release_notes_upgrade_patch_only: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of Enterprise Server. {% data ui.header.notices.release_notes_use_latest %}
ghes_release_notes_upgrade_release_only: 📣 This is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server. {% data ui.header.notices.release_notes_use_latest %}
ghes_release_notes_upgrade_patch_and_release: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of this release series, and this is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server. {% data ui.header.notices.release_notes_use_latest %}
release_notes:
banner_text_current: These changes will roll out over the next one week.
banner_text_past: These changes rolled out to enterprises during the week of
search:
need_help: Need help?
placeholder: Search topics, products...

View File

@@ -0,0 +1,156 @@
{% assign product = siteTree[currentLanguage][currentVersion].products[currentProduct] %}
{% assign currentVersionObject = allVersions[currentVersion] %}
<div class="d-flex">
<article class="min-width-0 flex-1">
<div class="d-flex flex-items-center flex-justify-between color-bg-primary text-bold px-5 py-2">
{% if prevRelease %}
<a
class="btn btn-outline"
href="/{{ currentLanguage }}/{{ currentVersionObject.plan }}@{{ prevRelease }}/{{ currentProduct }}/release-notes">
{% octicon "chevron-left" %} {{ prevRelease }}
</a>
{% else %}
<div></div>
{% endif %}
<h1 class="f4 py-3 m-0">{{ currentVersionObject.planTitle }} {{ currentVersionObject.currentRelease }} release notes</h1>
{% if nextRelease %}
<a
class="btn btn-outline"
href="/{{ currentLanguage }}/{{ currentVersionObject.plan }}@{{ nextRelease }}/{{ currentProduct }}/release-notes">
{{ nextRelease }} {% octicon "chevron-right" %}
</a>
{% else %}
<div></div>
{% endif %}
</div>
<div class="markdown-body">
{% for patch in releaseNotes %}
<div class="js-release-notes-patch mb-10 color-bg-secondary pb-6 border-bottom border-top" data-version="{{ patch.version }}" id="{{ patch.version }}">
<header style="z-index: 1;" class="container-xl position-sticky top-0 color-bg-secondary border-bottom px-3 pt-4 pb-2 js-release-notes-patch-heading" data-version="{{ patch.version }}">
<div class="d-flex flex-items-center">
<h2 class="border-bottom-0 m-0 p-0">
{{ currentVersionObject.versionTitle }}.{{ patch.patchVersion }}
</h2>
{% if patch.release_candidate %}
<span class="IssueLabel color-bg-warning-inverse color-text-inverse ml-3" style="white-space: pre">Release Candidate</span>
{% endif %}
{% if currentVersionObject.plan == "enterprise-server" %}
<a href="https://enterprise.github.com/releases/{{ patch.downloadVersion }}/download" class="ml-3 text-small text-bold">
Download
</a>
{% endif %}
<button class="js-print btn-link ml-3 text-small text-bold">
Print
</button>
</div>
<p class="color-text-secondary mt-1">{{ patch.date | date: "%B %d, %Y" }}</p>
{% if patch.version != latestPatch and currentVersionObject.currentRelease == latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_patch_only %}</p>
{% endif %}
{% if patch.version == latestPatch and currentVersionObject.currentRelease != latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_release_only %}</p>
{% endif %}
{% if patch.version != latestPatch and currentVersionObject.currentRelease != latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_patch_and_release %}</p>
{% endif %}
</header>
<div class="container-xl px-3">
<div class="mt-3">{{ patch.intro }}</div>
{% for section in patch.sections %}
<div class="release-notes-section-{{ section[0] }} py-6 d-block d-xl-flex gutter-xl flex-items-baseline {% unless forloop.last %}border-bottom{% endunless %}">
<div class="col-12 col-xl-3 mb-5">
{% include release-notes-category-label %}
</div>
<ul class="col-12 col-xl-9 release-notes-list">
{% for note in section[1] %}
<li class="release-notes-list-item {% if note.heading %}list-style-none{% endif %}">
{% if note.heading %}
{% assign slug = note.heading | slugify %}
<h4 id="{{ slug }}" class="release-notes-section-heading text-uppercase text-bold">
<a href="#{{ slug }}" class="text-inherit">{{ note.heading }}</a>
</h4>
<ul class="pl-0 pb-4 mt-2 release-notes-list">
{% for subNote in note.notes %}
<li class="release-notes-list-item">{{ subNote }}</li>
{% endfor %}
</ul>
{% else %}
{{ note }}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</article>
<aside
class="markdown-body position-sticky top-0 d-none d-md-block border-left no-print color-bg-primary flex-shrink-0"
style="width: 260px; height: 100vh;"
>
<nav class="height-full overflow-auto">
<ul class="list-style-none pl-0 text-bold">
{% for release in releases %}
{% capture releaseLink %}/{{ currentLanguage }}/{{ currentVersionObject.plan }}@{{ release.version }}/{{ currentProduct }}/release-notes{% endcapture %}
<li class="border-bottom">
{% if release.patches %}
{% if release.version == currentVersionObject.currentRelease %}
<details class="my-0 details-reset release-notes-version-picker" aria-current="page" open>
<summary class="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between">
{{ release.version }}
<div class="d-flex">
<span class="color-text-tertiary text-mono text-small text-normal mr-1">{{ release.patches | size }} releases</span>
{% octicon "chevron-down" %}
</div>
</summary>
<ul class="color-bg-tertiary border-top list-style-none py-4 px-0 my-0">
{% for patch in release.patches %}
<li class="js-release-notes-patch-link px-3 my-0 py-1" data-version="{{ patch.version }}">
<a
href="{{ releaseLink }}#{{ patch.version }}"
class="d-flex flex-items-center flex-justify-between">
{{ patch.version }}
<span class="color-text-tertiary text-mono text-small text-normal">{{ patch.date | date: "%B %d, %Y" }}</span>
</a>
</li>
{% endfor %}
</ul>
</details>
{% else %}
<a class="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between" href="{{ releaseLink }}">
{{ release.version }}
<span class="color-text-tertiary text-mono text-small text-normal mr-1">{{ release.patches | size }} releases</span>
</a>
{% endif %}
{% else %}
<a href="{{ releaseLink }}" class="Link--primary no-underline px-3 py-4 my-0 d-flex flex-items-center flex-justify-between">
{{ release.version }}
{% octicon "link-external" %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</aside>
</div>

View File

@@ -0,0 +1,104 @@
{% assign product = siteTree[currentLanguage][currentVersion].products[currentProduct] %}
{% assign currentVersionObject = allVersions[currentVersion] %}
<div class="d-flex">
<article class="min-width-0 flex-1">
<div class="d-flex flex-items-center flex-justify-between color-bg-primary px-5 py-2">
<div></div>
<h1 class="f4 py-3 m-0">{{ currentVersionObject.planTitle }} release notes</h1>
<div></div>
</div>
<div class="markdown-body">
{% for patch in releaseNotes %}
<div class="js-release-notes-patch mb-10 color-bg-secondary pb-6 border-bottom border-top" data-version="{{ patch.date }}" id="{{ patch.date }}">
<header style="z-index: 1;" class="container-xl position-sticky top-0 color-bg-secondary border-bottom px-3 pt-4 pb-2 js-release-notes-patch-heading" data-version="{{ patch.date }}">
<div class="d-flex flex-items-center">
<h2 class="border-bottom-0 m-0 p-0">
{{ patch.title }}
</h2>
{% if patch.release_candidate %}
<span class="IssueLabel color-bg-warning-inverse color-text-inverse ml-3" style="white-space: pre">Release Candidate</span>
{% endif %}
<button class="js-print btn-link ml-3 text-small text-bold">
Print
</button>
</div>
{% if patch.currentWeek %}
{% assign bannerText = site.data.ui.release_notes.banner_text_current %}
{% else %}
{% assign bannerText = site.data.ui.release_notes.banner_text_past | append: " " | append: patch.friendlyDate | append: "." %}
{% endif %}
<p class="color-text-secondary mt-1">{{ patch.friendlyDate }} - {{ bannerText }}</p>
</header>
<div class="container-xl px-3">
<div class="mt-3">{{ patch.intro }}</div>
{% for section in patch.sections %}
<div class="release-notes-section-{{ section[0] }} py-6 mx-6 d-block d-xl-flex gutter-xl flex-items-baseline {% unless forloop.last %}border-bottom{% endunless %}">
<ul class="col-12 release-notes-list">
{% for note in section[1] %}
<li class="release-notes-list-item {% if note.heading %}list-style-none{% endif %}">
{% if note.heading %}
{% assign slug = note.heading | slugify %}
<h4 id="{{ slug }}" class="release-notes-section-heading text-uppercase text-bold">
<a href="#{{ slug }}" class="text-inherit">{{ note.heading }}</a>
</h4>
<ul class="pl-0 pb-4 mt-2 release-notes-list">
{% for subNote in note.notes %}
<li class="release-notes-list-item">{{ subNote }}</li>
{% endfor %}
</ul>
{% else %}
{{ note }}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</article>
<aside
class="markdown-body position-sticky top-0 d-none d-md-block border-left no-print color-bg-primary flex-shrink-0"
style="width: 260px; height: 100vh;"
>
<nav class="height-full overflow-auto">
<ul class="list-style-none pl-0 text-bold">
{% for release in releases %}
<li class="border-bottom">
<details class="my-0 details-reset release-notes-version-picker" aria-current="page" open>
<summary class="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between">
{{ release.version }}
<div class="d-flex">
<span class="color-text-tertiary text-mono text-small text-normal mr-1">{{ release.patches | size }} releases</span>
{% octicon "chevron-down" %}
</div>
</summary>
<ul class="color-bg-tertiary border-top list-style-none py-4 px-0 my-0">
{% for patch in release.patches %}
<li class="js-release-notes-patch-link px-3 my-0 py-1" data-version="{{ patch.date }}">
<a
href="#{{ patch.date }}"
class="d-flex flex-items-center flex-justify-between">
{{ patch.friendlyDate }}
</a>
</li>
{% endfor %}
</ul>
</details>
</li>
{% endfor %}
</ul>
</nav>
</aside>
</div>

View File

@@ -1,5 +1,5 @@
<!-- Versions picker that only appears in the header on homepage or product landing -->
{% if page.relativePath == 'index.md' or page.layout == 'product-landing' or page.layout == 'product-sublanding' %}
{% if page.relativePath == 'index.md' or page.layout == 'product-landing' or page.layout == 'product-sublanding' or page.layout == 'release-notes' %}
{% if page.permalinks and page.permalinks.length > 1 %}
<div class="d-md-inline-block">
<div class="border-top border-md-top-0 py-2 py-md-0 d-md-inline-block">

View File

@@ -1,5 +1,3 @@
{% assign product = siteTree[currentLanguage][currentVersion].products[currentProduct] %}
<!doctype html>
<html lang="{{currentLanguage}}" data-color-mode="$COLORMODE$" data-dark-theme="$DARKTHEME$" data-light-theme="$LIGHTTHEME$">
{% include head %}
@@ -11,156 +9,13 @@
{% include header %}
{% include deprecation-banner %}
<div class="d-flex">
<article class="min-width-0 flex-1">
<div class="d-flex flex-items-center flex-justify-between color-bg-primary text-bold px-5 py-2">
{% if prevRelease %}
<a
class="btn btn-outline"
href="/{{ currentLanguage }}/{{ allVersions[currentVersion].plan }}@{{ prevRelease }}/{{ currentProduct }}/release-notes">
{% octicon "chevron-left" %} {{ prevRelease }}
</a>
{% else %}
<div></div>
{% endif %}
{% if allVersions[currentVersion].plan == 'enterprise-server' %}
{% include enterprise-server-release-notes %}
{% endif %}
<h1 class="f4 py-3 m-0">{{ currentVersion | version_num }} Release notes</h1>
{% if nextRelease %}
<a
class="btn btn-outline"
href="/{{ currentLanguage }}/{{ allVersions[currentVersion].plan }}@{{ nextRelease }}/{{ currentProduct }}/release-notes">
{{ nextRelease }} {% octicon "chevron-right" %}
</a>
{% else %}
<div></div>
{% endif %}
</div>
<div class="markdown-body">
{% for patch in releaseNotes %}
<div class="js-release-notes-patch mb-10 color-bg-secondary pb-6 border-bottom border-top" data-version="{{ patch.version }}" id="{{ patch.version }}">
<header style="z-index: 1;" class="container-xl position-sticky top-0 color-bg-secondary border-bottom px-3 pt-4 pb-2 js-release-notes-patch-heading" data-version="{{ patch.version }}">
<div class="d-flex flex-items-center">
<h2 class="border-bottom-0 m-0 p-0">
{{ allVersions[currentVersion].versionTitle }}.{{ patch.patchVersion }}
</h2>
{% if patch.release_candidate %}
<span class="IssueLabel color-bg-warning-inverse color-text-inverse ml-3" style="white-space: pre">Release Candidate</span>
{% endif %}
<a href="https://enterprise.github.com/releases/{{ patch.downloadVersion }}/download" class="ml-3 text-small text-bold">
Download
</a>
<button class="js-print btn-link ml-3 text-small text-bold">
Print
</button>
</div>
<p class="color-text-secondary mt-1">{{ patch.date | date: "%B %d, %Y" }}</p>
{% if patch.version != latestPatch and allVersions[currentVersion].currentRelease == latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_patch_only %}</p>
{% endif %}
{% if patch.version == latestPatch and allVersions[currentVersion].currentRelease != latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_release_only %}</p>
{% endif %}
{% if patch.version != latestPatch and allVersions[currentVersion].currentRelease != latestRelease %}
<p class="color-text-secondary mt-1">{% data ui.header.notices.ghes_release_notes_upgrade_patch_and_release %}</p>
{% endif %}
</header>
<div class="container-xl px-3">
<div class="mt-3">{{ patch.intro }}</div>
{% for section in patch.sections %}
<div class="release-notes-section-{{ section[0] }} py-6 d-block d-xl-flex gutter-xl flex-items-baseline {% unless forloop.last %}border-bottom{% endunless %}">
<div class="col-12 col-xl-3 mb-5">
{% include release-notes-category-label %}
</div>
<ul class="col-12 col-xl-9 release-notes-list">
{% for note in section[1] %}
<li class="release-notes-list-item {% if note.heading %}list-style-none{% endif %}">
{% if note.heading %}
{% assign slug = note.heading | slugify %}
<h4 id="{{ slug }}" class="release-notes-section-heading text-uppercase text-bold">
<a href="#{{ slug }}" class="text-inherit">{{ note.heading }}</a>
</h4>
<ul class="pl-0 pb-4 mt-2 release-notes-list">
{% for subNote in note.notes %}
<li class="release-notes-list-item">{{ subNote }}</li>
{% endfor %}
</ul>
{% else %}
{{ note }}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</article>
<aside
class="markdown-body position-sticky top-0 d-none d-md-block border-left no-print color-bg-primary flex-shrink-0"
style="width: 260px; height: 100vh;"
>
<nav class="height-full overflow-auto">
<ul class="list-style-none pl-0 text-bold">
{% for release in releases %}
<li class="border-bottom">
{% if release.patches %}
{% if release.version == allVersions[currentVersion].currentRelease %}
<details class="my-0 details-reset release-notes-version-picker" aria-current="page" open>
<summary class="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between">
{{ release.version }}
<div class="d-flex">
<span class="color-text-tertiary text-mono text-small text-normal mr-1">{{ release.patches | size }} releases</span>
{% octicon "chevron-down" %}
</div>
</summary>
<ul class="color-bg-tertiary border-top list-style-none py-4 px-0 my-0">
{% for patch in release.patches %}
<li class="js-release-notes-patch-link px-3 my-0 py-1" data-version="{{ patch.version }}">
<a
href="/{{ currentLanguage }}/{{ allVersions[currentVersion].plan }}@{{ release.version }}/{{ currentProduct }}/release-notes#{{ patch.version }}"
class="d-flex flex-items-center flex-justify-between">
{{ patch.version }}
<span class="color-text-tertiary text-mono text-small text-normal">{{ patch.date | date: "%B %d, %Y" }}</span>
</a>
</li>
{% endfor %}
</ul>
</details>
{% else %}
<a class="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between" href="/{{ currentLanguage }}/{{ allVersions[currentVersion].plan }}@{{ release.version }}/{{ currentProduct }}/release-notes">
{{ release.version }}
<span class="color-text-tertiary text-mono text-small text-normal mr-1">{{ release.patches | size }} releases</span>
</a>
{% endif %}
{% else %}
<a href="/{{ currentLanguage }}/{{ allVersions[currentVersion].plan }}@{{ release.version }}/{{ currentProduct }}/release-notes" class="Link--primary no-underline px-3 py-4 my-0 d-flex flex-items-center flex-justify-between">
{{ release.version }}
{% octicon "link-external" %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</aside>
</div>
{% if allVersions[currentVersion].plan == 'github-ae' %}
{% include github-ae-release-notes %}
{% endif %}
{% include support-section %}
{% include small-footer %}

103
lib/release-notes-utils.js Normal file
View File

@@ -0,0 +1,103 @@
const semver = require('semver')
const renderContent = require('./render-content')
/**
* Turn { [key]: { notes, intro, date } }
* into [{ version, notes, intro, date }]
*/
function sortPatchKeys (release, version, options = {}) {
const keys = Object.keys(release)
.map(key => {
const keyWithDots = key.replace(/-/g, '.')
return {
version: `${version}.${keyWithDots}`,
patchVersion: keyWithDots,
release: version, // TODO this naming :/ we are not currently using this value, but we may want to.
...release[key]
}
})
// Filter out any deprecated patches
.filter(key => !key.deprecated)
// Versions with numbered releases like GHES 2.22, 3.0, etc. need additional semver sorting;
// Versions with date releases need to be sorted by date.
return options.semverSort
? semverSort(keys)
: keys.sort((a, b) => new Date(b.date) - new Date(a.date))
}
function semverSort (keys) {
return keys
.sort((a, b) => {
let aTemp = a.version
let bTemp = b.version
// There's an RC version here, so doing regular semver
// comparisons won't work. So, we'll convert the incompatible version
// strings to real semver strings, then compare.
const [aBase, aRc] = a.version.split('.rc')
if (aRc) aTemp = `${aBase}-rc.${aRc}`
const [bBase, bRc] = b.version.split('.rc')
if (bRc) bTemp = `${bBase}-rc.${bRc}`
if (semver.gt(aTemp, bTemp)) return -1
if (semver.lt(aTemp, bTemp)) return 1
return 0
})
}
/**
* Render each note in the given patch, by looping through the
* sections and rendering either `note` or `note.notes` in the
* case of a sub-section
*/
async function renderPatchNotes (patch, ctx) {
// Run the notes through the markdown rendering pipeline
for (const key in patch.sections) {
await Promise.all(patch.sections[key].map(async (noteOrHeading, index) => {
patch.sections[key][index] = typeof noteOrHeading === 'string'
? await renderContent(noteOrHeading, ctx)
: {
...noteOrHeading,
notes: await Promise.all(noteOrHeading.notes.map(note => renderContent(note, ctx)))
}
}))
}
// Also render the patch's intro
if (patch.intro) {
patch.intro = await renderContent(patch.intro, ctx)
}
return patch
}
function sortReleasesByDate (releaseNotes) {
return Object.keys(releaseNotes)
.map(release => {
const [year, month] = release.split('-')
return {
name: release,
date: new Date(`20${year}`, month - 1, '1')
}
})
.sort((releaseEntry1, releaseEntry2) => releaseEntry2.date - releaseEntry1.date)
.map(releaseEntry => releaseEntry.name)
}
function getAllReleases (releases, releaseNotesPerPlan, hasNumberedReleases) {
return releases.map(version => {
const release = releaseNotesPerPlan[version.replace(/\./g, '-')]
if (!release) return { version }
const patches = sortPatchKeys(release, version, { semverSort: hasNumberedReleases })
return { version, patches }
})
}
module.exports = {
sortReleasesByDate,
sortPatchKeys,
renderPatchNotes,
getAllReleases
}

View File

@@ -50198,6 +50198,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "https://api.github.com",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -94693,184 +94872,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "https://api.github.com",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

View File

@@ -31642,6 +31642,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.18/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -65625,184 +65804,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.18/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

View File

@@ -32239,6 +32239,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.19/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -66245,184 +66424,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.19/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

View File

@@ -32713,6 +32713,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.20/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -66807,184 +66986,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.20/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

View File

@@ -36277,6 +36277,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.21/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -71042,184 +71221,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.21/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

View File

@@ -44064,6 +44064,185 @@
}
]
},
{
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.22/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
},
{
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/contents/{path}",
@@ -78682,184 +78861,5 @@
],
"bodyParameters": [],
"descriptionHTML": "<p>Get a random sentence from the Zen of GitHub</p>"
},
{
"verb": "post",
"requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments",
"serverUrl": "http(s)://{hostname}/api/v3",
"parameters": [
{
"name": "owner",
"description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The owner of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "repo",
"description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"descriptionHTML": "<p>The name of the repository. Determined from the <code>repository</code> <code>full_name</code> of the <code>content_reference</code> event.</p>"
},
{
"name": "content_reference_id",
"description": "The `id` of the `content_reference` event.",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"descriptionHTML": "<p>The <code>id</code> of the <code>content_reference</code> event.</p>"
}
],
"x-codeSamples": [
{
"lang": "Shell",
"source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'</code></pre>"
},
{
"lang": "JavaScript",
"source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})",
"html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /{owner}/{repo}/content_references/{content_reference_id}/attachments'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">content_reference_id</span>: <span class=\"hljs-number\">42</span>,\n <span class=\"hljs-attr\">title</span>: <span class=\"hljs-string\">'title'</span>,\n <span class=\"hljs-attr\">body</span>: <span class=\"hljs-string\">'body'</span>,\n <span class=\"hljs-attr\">mediaType</span>: {\n <span class=\"hljs-attr\">previews</span>: [\n <span class=\"hljs-string\">'corsair'</span>\n ]\n }\n})\n</code></pre>"
}
],
"summary": "Create a content attachment",
"description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.",
"tags": [
"apps"
],
"operationId": "apps/create-content-attachment",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"title": {
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
"body": {
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
},
"required": [
"title",
"body"
],
"type": "object"
}
}
}
},
"x-github": {
"githubCloudOnly": false,
"enabledForGitHubApps": true,
"previews": [
{
"required": true,
"name": "corsair",
"note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```",
"html": "<p>To access the Content Attachments API during the preview period, you must provide a custom <a href=\"https://docs.github.com/enterprise-server@2.22/rest/overview/media-types\">media type</a> in the <code>Accept</code> header:</p>\n<pre><code class=\"hljs language-shell\">application/vnd.github.corsair-preview+json</code></pre>"
}
],
"category": "apps",
"subcategory": "installations"
},
"slug": "create-a-content-attachment",
"category": "apps",
"categoryLabel": "Apps",
"subcategory": "installations",
"subcategoryLabel": "Installations",
"notes": [],
"descriptionHTML": "<p>Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the <code>id</code> and <code>repository</code> <code>full_name</code> of the content reference from the <a href=\"https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference\"><code>content_reference</code> event</a> to create an attachment.</p>\n<p>The app must create a content attachment within six hours of the content reference URL being posted. See \"<a href=\"https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/\">Using content attachments</a>\" for details about content attachments.</p>\n<p>You must use an <a href=\"https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation\">installation access token</a> to access this endpoint.</p>",
"bodyParameters": [
{
"description": "<p><strong>Required</strong>. The title of the attachment</p>",
"example": "Title of the attachment",
"type": "string",
"maxLength": 1024,
"name": "title",
"in": "body",
"rawType": "string",
"rawDescription": "The title of the attachment",
"childParamsGroups": []
},
{
"description": "<p><strong>Required</strong>. The body of the attachment</p>",
"example": "Body of the attachment",
"type": "string",
"maxLength": 262144,
"name": "body",
"in": "body",
"rawType": "string",
"rawDescription": "The body of the attachment",
"childParamsGroups": []
}
],
"responses": [
{
"httpStatusCode": "200",
"httpStatusMessage": "OK",
"description": "Response",
"payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">101</span>,\n <span class=\"hljs-attr\">\"title\"</span>: <span class=\"hljs-string\">\"[A-1234] Error found in core/models.py file'\"</span>,\n <span class=\"hljs-attr\">\"body\"</span>: <span class=\"hljs-string\">\"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"</span>\n}\n</code></pre>"
},
{
"httpStatusCode": "304",
"httpStatusMessage": "Not Modified",
"description": "Not modified"
},
{
"httpStatusCode": "403",
"httpStatusMessage": "Forbidden",
"description": "Forbidden"
},
{
"httpStatusCode": "404",
"httpStatusMessage": "Not Found",
"description": "Resource not found"
},
{
"httpStatusCode": "410",
"httpStatusMessage": "Gone",
"description": "Gone"
},
{
"httpStatusCode": "415",
"httpStatusMessage": "Unsupported Media Type",
"description": "Preview header missing"
},
{
"httpStatusCode": "422",
"httpStatusMessage": "Unprocessable Entity",
"description": "Validation failed"
}
]
}
]

Some files were not shown because too many files have changed in this diff Show More