* Empty commit * updated beta note for GHAE * more GHAE update + resolve conflict * more GHAE updates + prepare for screenshots * Apply suggestions from code review Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> * address remaining review comments * Revise "About GitHub AE" (#17679) * add screenshots to the Configuring article * reworked to have a separate GHAE section * list numbering * more work on screenshots and conditions * add GHAE screenshots in article * review screenshots in article * added more screenshots and updated more articles * screenshot madness * fix liquid versioning * refactor the ghae script * [GHAE CB/Feb 22]: Add article about data residency for GitHub AE (#17847) * add missing GHAE versioning to article * move screenshots to GHAE asset directory * forgot to change the path for these two images * replace CBB screenshot + add better screenshot * [GHAE CB/Feb 22]: Document upgrades for GitHub AE (#17848) * Version article for GitHub AE * Replace unused variable * Incorporate reviewer feedback * Update intro Co-authored-by: Ethan P <56270045+ethanpalm@users.noreply.github.com> * [GHAE] Enable IP allow list (#17691) * Notes for CC * Updat permission leves chart * Add updated article to further reading * Update gated feature callout with GitHub AE * Version "Managing allowed IP addresses for your organization" for AE * Update images * Update "Restricting network traffic to your enterprise" with new procedures * remove todo note * Update audited actions * Update info about Premium Runners * Use reusable for Premium Runners * Change "Premium Runners" to "AE hosted runners" * Incorporate reviewer feedback * Use correct reusable * Version reusable correctly * [Feb 22] GHAE: Code scanning beta (#17830) * Add "github-ae" to all the frontmatter * GHAE-ify the reusables * Add some more changes * Re-use some content * 🔪 Semmle links * Revert change re "--external-repository-token" in the CodeQL runner * Update CodeQL runner token scopes * Update two screenshots * Remove mention of GitHub.com from AE + other fixes * Apply suggestions from code review Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> * Use `product_name` variable instead of `product_location` * Remove confusing phrase * [Feb 22] GHAE: Code scanning API and webhook docs (#17883) * Version API and webhook docs * Actually add versioning for GHAE * Fix anchor * [TEMPORARY] Preview for API endpoints * Revert API previews * Update procedure step Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> * Update docs for AzureAD Group SCIM support in GHAE (#17892) * [GHAE CB] SMTP bootstrapping flow (#17888) * draft * update with AE conntent * update with tons of versioning * remove that lie * fill out the rest of these steps * update with correct versioning * more edits * add images * reversion most of ae article * fix versioning * format correctlly * words matter * last image * update with permmissions * update versioning * add link * apply feedback ❤️ * update with differrent spacing * update with feedback * more feedback * Temporary GHAE release notes for consumables beta launch (#17859) * Create release-notes.md * Add frontmatter * Add to index file * Update github-ae-release-notes.md * Add release notes from Google Doc * Update finalized docs links that have been reviewed * OAuth device flow link update * version for AE * few fixes * Update content/admin/overview/github-ae-release-notes.md * small edits * whoops * commit * update with different links * used wrong reusable * fix more brokenness * Update repository-references.js * Update repository-references.js Co-authored-by: Meg Bird <megbird@github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> * [GHAE] Audit public repos (#17917) * verifying what we mean by public * Apply suggestions from code review * Update content/developers/apps/installing-github-apps.md Co-authored-by: Laura Coursen <lecoursen@github.com> * fixing placememnt of liquid conditional Co-authored-by: Laura Coursen <lecoursen@github.com> * GHAE packages beta (#17786) Co-authored-by: jmarlena <6732600+jmarlena@users.noreply.github.com> Co-authored-by: Martin Lopes <martin389@github.com> * fix broken links * [GHAE CB/March 01]: GitHub Actions on GHAE (beta) (#17725) * Added initial layout for premium runners * Restructured content * Added placeholder for removing premium runner * Added versioning and warning note for self-hosted runners * Added versioning and beta notice for actions content * Rephrased beta note * Added versioning for API docs, fixes * Added versioning fixes * Split Github-hosted and premium topics into separate articles * Added edits * Restructured some topics * Revised "Using premium runners in a workflow" * Some small fixes * Fixed typo * Added fixes to reusable * Added edits * Made section titles consistent * Added billing, group mgmt, reusable steps * Cropped certain screenshots for future-proofing * Removed superfluous reusable * Added fixes * Revert "Cropped certain screenshots for future-proofing" This reverts commit c7f24f31fa30d4fe3de2b63fc3cd5feba44ef518. * Added new section for custom images * Added versioning for enterprise-admin operations * Added edits * Added edits * Update adding-premium-runners.md * Removed SHR screenshots. Intending to update them when UI is available. * Update using-labels-with-premium-runners.md * Added custom labels section * Added preview of API docs changes * Added versioning for ip allow list section * Removed removal article * Renamed premium runners to AE hosted runners * Re-added added API preview * Fixed links, updated software specs * Revised "Software specifications" based on feedback * Fixed typos * Small fixes * Added new article "Creating custom images" * Moved "Creating custom images" link * Apply suggestions from code review Co-authored-by: ahdbilal <55514721+ahdbilal@users.noreply.github.com> * Added update from review * Added updates from tech review * Apply suggestions from code review Co-authored-by: ahdbilal <55514721+ahdbilal@users.noreply.github.com> * Added updates from tech review * Added updates from tech review * Added updates from tech review * Added updates from tech review * Fixed reusable * Added fixes * Added update from tech review * Removed the dereferenced OpenAPI schema files * Added fixes * Fixed links * Fixed links * Apply suggestions from code review Co-authored-by: jmarlena <6732600+jmarlena@users.noreply.github.com> * Added updates from peer review * Removed sections that are not in beta * Update viewing-your-github-actions-usage.md * Update viewing-job-execution-time.md * Update index.md * Update about-github-hosted-runners.md * Restored versioning to match GHES approach * Fixed link * Restored self-hosted runner reference to UI steps. * Updated screenshots * Updated screenshots and procedures * Small edits to screenshots * Added AE url info for SHR * Removed superfluous versioning * Update security-hardening-for-github-actions.md * Update actions-shared.md * Small edits * Update usage-limits-billing-and-administration.md * Update managing-complex-workflows.md * Additional versioning * Additional versioning * version environments api and checkrun deployments for ghae (#17991) Co-authored-by: Martin Lopes <martin389@github.com> * Update reviewing-the-audit-log-for-your-organization.md * Added versioning for enterprise policy settings * version configuring artifact retention for AE * remove AE versioning for connecting to Marketplace * Apply suggestions from code review Co-authored-by: Joe Bourne <thejoebourneidentity@github.com> * Update content/admin/github-actions/getting-started-with-github-actions-for-github-ae.md Co-authored-by: Joe Bourne <thejoebourneidentity@github.com> * rewording not public to private * fixing liquid * Fixed elseif entries * Added expectations note * Revised label management article for AE hosted runners * Added enterprise-admin note for adding AE hosted runners * Update enterprise-admin.md * Update self-hosted-runner-security.md * Versioned reusable for AE * Empty commit for CI Co-authored-by: ahdbilal <55514721+ahdbilal@users.noreply.github.com> Co-authored-by: jmarlena <6732600+jmarlena@users.noreply.github.com> Co-authored-by: skedwards88 <skedwards88@github.com> Co-authored-by: Leona B. Campbell <3880403+runleonarun@users.noreply.github.com> Co-authored-by: Joe Bourne <thejoebourneidentity@github.com> Co-authored-by: runleonarun <runleonarun@github.com> * Update OpenAPI Descriptions for GHAE * Update content/admin/overview/github-ae-release-notes.md Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: mchammer01 <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> Co-authored-by: shati-patel <shati-patel@github.com> Co-authored-by: Sarah Schneider <sarahs@github.com> Co-authored-by: skedwards88 <skedwards88@github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> Co-authored-by: Melanie Yarbrough <11952755+myarb@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: Meg Bird <megbird@github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Leona B. Campbell <3880403+runleonarun@users.noreply.github.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: jmarlena <6732600+jmarlena@users.noreply.github.com> Co-authored-by: Martin Lopes <martin389@github.com> Co-authored-by: ahdbilal <55514721+ahdbilal@users.noreply.github.com> Co-authored-by: Joe Bourne <thejoebourneidentity@github.com> Co-authored-by: runleonarun <runleonarun@github.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com>
19 KiB
title, allowTitleToDifferFromFilename, redirect_from, versions
| title | allowTitleToDifferFromFilename | redirect_from | versions | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Repositories | true |
|
|
{% for operation in currentRestOperations %} {% unless operation.subcategory %}{% include rest_operation %}{% endunless %} {% endfor %}
Branches
{% for operation in currentRestOperations %} {% if operation.subcategory == 'branches' %}{% include rest_operation %}{% endif %} {% endfor %}
Collaborators
{% for operation in currentRestOperations %} {% if operation.subcategory == 'collaborators' %}{% include rest_operation %}{% endif %} {% endfor %}
Comments
Custom media types for commit comments
These are the supported media types for commit comments. You can read more about the use of media types in the API here.
application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json
For more information, see "Custom media types."
{% for operation in currentRestOperations %} {% if operation.subcategory == 'comments' %}{% include rest_operation %}{% endif %} {% endfor %}
Commits
The Repo Commits API supports listing, viewing, and comparing commits in a repository.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'commits' %}{% include rest_operation %}{% endif %} {% endfor %}
{% if currentVersion == "free-pro-team@latest" %}
Community
{% for operation in currentRestOperations %} {% if operation.subcategory == 'community' %}{% include rest_operation %}{% endif %} {% endfor %}
{% endif %}
Contents
These API endpoints let you create, modify, and delete Base64 encoded content in a repository. To request the raw format or rendered HTML (when supported), use custom media types for repository contents.
Custom media types for repository contents
READMEs, files, and symlinks support the following custom media types:
application/vnd.github.VERSION.raw
application/vnd.github.VERSION.html
Use the .raw media type to retrieve the contents of the file.
For markup files such as Markdown or AsciiDoc, you can retrieve the rendered HTML using the .html media type. Markup languages are rendered to HTML using our open-source Markup library.
All objects support the following custom media type:
application/vnd.github.VERSION.object
Use the object media type parameter to retrieve the contents in a consistent object format regardless of the content type. For example, instead of an array of objects
for a directory, the response will be an object with an entries attribute containing the array of objects.
You can read more about the use of media types in the API here.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'contents' %}{% include rest_operation %}{% endif %} {% endfor %}
Deploy keys
{% data reusables.repositories.deploy-keys %}
Deploy keys can either be setup using the following API endpoints, or by using GitHub. To learn how to set deploy keys up in GitHub, see "Managing deploy keys."
{% for operation in currentRestOperations %} {% if operation.subcategory == 'keys' %}{% include rest_operation %}{% endif %} {% endfor %}
Deployments
Deployments are requests to deploy a specific ref (branch, SHA, tag). GitHub dispatches a deployment event that external services can listen for and act on when new deployments are created. Deployments enable developers and organizations to build loosely coupled tooling around deployments, without having to worry about the implementation details of delivering different types of applications (e.g., web, native).
Deployment statuses allow external services to mark deployments with an error, failure, pending, in_progress, queued, or success state that systems listening to deployment_status events can consume.
Deployment statuses can also include an optional description and log_url, which are highly recommended because they make deployment statuses more useful. The log_url is the full URL to the deployment output, and
the description is a high-level summary of what happened with the deployment.
GitHub dispatches deployment and deployment_status events when new deployments and deployment statuses are created. These events allows third-party integrations to receive respond to deployment requests and update the status of a deployment as progress is made.
Below is a simple sequence diagram for how these interactions would work.
+---------+ +--------+ +-----------+ +-------------+
| Tooling | | GitHub | | 3rd Party | | Your Server |
+---------+ +--------+ +-----------+ +-------------+
| | | |
| Create Deployment | | |
|--------------------->| | |
| | | |
| Deployment Created | | |
|<---------------------| | |
| | | |
| | Deployment Event | |
| |---------------------->| |
| | | SSH+Deploys |
| | |-------------------->|
| | | |
| | Deployment Status | |
| |<----------------------| |
| | | |
| | | Deploy Completed |
| | |<--------------------|
| | | |
| | Deployment Status | |
| |<----------------------| |
| | | |
Keep in mind that GitHub is never actually accessing your servers. It's up to your third-party integration to interact with deployment events. Multiple systems can listen for deployment events, and it's up to each of those systems to decide whether they're responsible for pushing the code out to your servers, building native code, etc.
Note that the repo_deployment OAuth scope grants targeted access to deployments and deployment statuses without granting access to repository code, while the public_repo and repo scopes grant permission to code as well.
Inactive deployments
When you set the state of a deployment to success, then all prior non-transient, non-production environment deployments in the same repository to the same environment name will become inactive. To avoid this, you can set auto_inactive to false when creating the deployment status.
You can communicate that a transient environment no longer exists by setting its state to inactive. Setting the state to inactive shows the deployment as destroyed in {% data variables.product.prodname_dotcom %} and removes access to it.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'deployments' %}{% include rest_operation %}{% endif %} {% endfor %}
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}
Environments
The Environments API allows you to create, configure, and delete environments. For more information about environments, see "Environments." {% for operation in currentRestOperations %} {% if operation.subcategory == 'environments' %}{% include rest_operation %}{% endif %} {% endfor %} {% endif %}
Forks
{% for operation in currentRestOperations %} {% if operation.subcategory == 'forks' %}{% include rest_operation %}{% endif %} {% endfor %}
Invitations
The Repository Invitations API allows users or external services to invite other users to collaborate on a repo. The invited users (or external services on behalf of invited users) can choose to accept or decline the invitations.
Note that the repo:invite OAuth scope grants targeted
access to invitations without also granting access to repository code, while the
repo scope grants permission to code as well as invitations.
Invite a user to a repository
Use the API endpoint for adding a collaborator. For more information, see "Add a repository collaborator."
{% for operation in currentRestOperations %} {% if operation.subcategory == 'invitations' %}{% include rest_operation %}{% endif %} {% endfor %}
Merging
The Repo Merging API supports merging branches in a repository. This accomplishes essentially the same thing as merging one branch into another in a local repository and then pushing to {% data variables.product.product_name %}. The benefit is that the merge is done on the server side and a local repository is not needed. This makes it more appropriate for automation and other tools where maintaining local repositories would be cumbersome and inefficient.
The authenticated user will be the author of any merges done through this endpoint.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'merging' %}{% include rest_operation %}{% endif %} {% endfor %}
Pages
The {% data variables.product.prodname_pages %} API retrieves information about your {% data variables.product.prodname_pages %} configuration, and the statuses of your builds. Information about the site and the builds can only be accessed by authenticated owners, even though the websites are public. For more information, see "About {% data variables.product.prodname_pages %}."
In {% data variables.product.prodname_pages %} API endpoints with a status key in their response, the value can be one of:
null: The site has yet to be built.queued: The build has been requested but not yet begun.building:The build is in progress.built: The site has been built.errored: Indicates an error occurred during the build.
In {% data variables.product.prodname_pages %} API endpoints that return GitHub Pages site information, the JSON responses include these fields:
html_url: The absolute URL (including scheme) of the rendered Pages site. For example,https://username.github.io.source: An object that contains the source branch and directory for the rendered Pages site. This includes:branch: The repository branch used to publish your site's source files. For example, main or gh-pages.path: The repository directory from which the site publishes. Will be either/or/docs.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'pages' %}{% include rest_operation %}{% endif %} {% endfor %}
Releases
{% note %}
Note: The Releases API replaces the Downloads API. You can retrieve the download count and browser download URL from the endpoints in this API that return releases and release assets.
{% endnote %}
{% for operation in currentRestOperations %} {% if operation.subcategory == 'releases' %}{% include rest_operation %}{% endif %} {% endfor %}
Statistics
The Repository Statistics API allows you to fetch the data that {% data variables.product.product_name %} uses for visualizing different types of repository activity.
A word about caching
Computing repository statistics is an expensive operation, so we try to return cached
data whenever possible. If the data hasn't been cached when you query a repository's
statistics, you'll receive a 202 response; a background job is also fired to
start compiling these statistics. Give the job a few moments to complete, and
then submit the request again. If the job has completed, that request will receive a
200 response with the statistics in the response body.
Repository statistics are cached by the SHA of the repository's default branch; pushing to the default branch resets the statistics cache.
Statistics exclude some types of commits
The statistics exposed by the API match the statistics shown by different repository graphs.
To summarize:
- All statistics exclude merge commits.
- Contributor statistics also exclude empty commits.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'statistics' %}{% include rest_operation %}{% endif %} {% endfor %}
Statuses
The status API allows external services to mark commits with an error,
failure, pending, or success state, which is then reflected in pull requests
involving those commits.
Statuses can also include an optional description and target_url, and
we highly recommend providing them as they make statuses much more
useful in the GitHub UI.
As an example, one common use is for continuous integration
services to mark commits as passing or failing builds using status. The
target_url would be the full URL to the build output, and the
description would be the high level summary of what happened with the
build.
Statuses can include a context to indicate what service is providing that status.
For example, you may have your continuous integration service push statuses with a context of ci, and a security audit tool push statuses with a context of security. You can
then use the Get the combined status for a specific reference to retrieve the whole status for a commit.
Note that the repo:status OAuth scope grants targeted access to statuses without also granting access to repository code, while the
repo scope grants permission to code as well as statuses.
If you are developing a GitHub App and want to provide more detailed information about an external service, you may want to use the Checks API.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'statuses' %}{% include rest_operation %}{% endif %} {% endfor %}
{% if currentVersion == "free-pro-team@latest" %}
Traffic
For repositories that you have push access to, the traffic API provides access to the information provided in your repository graph. For more information, see "Viewing traffic to a repository."
{% for operation in currentRestOperations %} {% if operation.subcategory == 'traffic' %}{% include rest_operation %}{% endif %} {% endfor %} {% endif %}
Webhooks
The Repository Webhooks API allows repository admins to manage the post-receive hooks for a repository. Webhooks can be managed using the JSON HTTP API, or the PubSubHubbub API.
If you would like to set up a single webhook to receive events from all of your organization's repositories, see our API documentation for Organization Webhooks.
{% for operation in currentRestOperations %} {% if operation.subcategory == 'webhooks' %}{% include rest_operation %}{% endif %} {% endfor %}
Receiving Webhooks
In order for {% data variables.product.product_name %} to send webhook payloads, your server needs to be accessible from the Internet. We also highly suggest using SSL so that we can send encrypted payloads over HTTPS.
Webhook headers
{% data variables.product.product_name %} will send along several HTTP headers to differentiate between event types and payload identifiers. See webhook headers for details.
PubSubHubbub
GitHub can also serve as a PubSubHubbub hub for all repositories. PSHB is a simple publish/subscribe protocol that lets servers register to receive updates when a topic is updated. The updates are sent with an HTTP POST request to a callback URL. Topic URLs for a GitHub repository's pushes are in this format:
https://github.com/{owner}/{repo}/events/{event}
The event can be any available webhook event. For more information, see "Webhook events and payloads."
Response format
The default format is what existing post-receive hooks should expect: A JSON body sent as the payload parameter in a POST. You can also specify to receive the raw JSON body with either an Accept header, or a .json extension.
Accept: application/json
https://github.com/{owner}/{repo}/events/push.json
Callback URLs
Callback URLs can use the http:// protocol. {% if enterpriseServerVersions contains currentVersion and currentVersion ver_lt "enterprise-server@2.20" %}You can also github:// callbacks to specify a GitHub service.
{% data reusables.apps.deprecating_github_services_ghe %}
{% endif %}
# Send updates to postbin.org
http://postbin.org/123
{% if enterpriseServerVersions contains currentVersion and currentVersion ver_lt "enterprise-server@2.20" %} # Send updates to Campfire github://campfire?subdomain=github&room=Commits&token=abc123 {% endif %}
Subscribing
The GitHub PubSubHubbub endpoint is: {% data variables.product.api_url_code %}/hub. A successful request with curl looks like:
curl -u "user" -i \
{% data variables.product.api_url_pre %}/hub \
-F "hub.mode=subscribe" \
-F "hub.topic=https://github.com/{owner}/{repo}/events/push" \
-F "hub.callback=http://postbin.org/123"
PubSubHubbub requests can be sent multiple times. If the hook already exists, it will be modified according to the request.
Parameters
| 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 for more details. |