Skip to content

Commit

Permalink
Merge pull request github#35354 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Nov 19, 2024
2 parents 5da52c7 + 0ff4b8c commit 4557882
Show file tree
Hide file tree
Showing 50 changed files with 504 additions and 97 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codeowners-content-systems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- 'contributing/content-*.md'
- 'content/contributing/**.md'
- .github/workflows/codeowners-content-systems.yml

jobs:
codeowners-content-systems:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeowners-docs-engineering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
- '.github/**'
- '**Dockerfile'
- 'package*.json'
- .github/workflows/codeowners-docs-engineering.yml

jobs:
codeowners-docs-engineering:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeowners-legal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- synchronize
paths:
- 'content/**'
- .github/workflows/codeowners-legal.yml

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/comment-release-note-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- opened
paths:
- data/release-notes/enterprise-server/**
- .github/workflows/comment-release-note-info.yml

permissions:
contents: read
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dont-delete-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- main
paths:
- 'assets/**'
- '.github/workflows/dont-delete-assets.yml'

permissions:
contents: read
Expand All @@ -37,7 +38,7 @@ jobs:
id: comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: src/assets/scripts/deleted-assets-pr-comment.js
run: npm run deleted-assets-pr-comment

- name: Find possible previous comment
if: ${{ steps.comment.outputs.markdown != '' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dont-delete-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- main
paths:
- 'data/features/**'
- .github/workflows/dont-delete-features.yml

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/hubber-contribution-help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
types:
- opened
paths:
- .github/workflows/hubber-contribution-help.yml
- 'content/**'
- 'data/**'

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/orphaned-files-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
paths:
- .github/workflows/orphaned-assets-check.yml
- .github/workflows/orphaned-files-check.yml
# In case any of the dependencies affect the script
- 'package*.json'
- src/assets/scripts/find-orphaned-assets.js
Expand Down Expand Up @@ -96,7 +97,7 @@ jobs:
The first responder should just spot-check some of the unused assets
to make sure they aren't referenced anywhere
and then approve and merge the pull request.
For more information, see [Doc: Orphaned Assets](https://github.com/github/docs-engineering/blob/main/docs/orphaned-assets.md)
For more information, see [Doc: Orphaned Assets](https://github.com/github/docs-engineering/blob/main/docs/orphaned-assets.md)
and [Doc: Reusables CLI](https://github.com/github/docs-internal/tree/main/src/content-render/scripts/reusables-cli).
EOM
)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/site-policy-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- closed
paths:
- 'content/site-policy/**'
- '.github/workflows/site-policy-sync.yml'
workflow_dispatch:

permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-changed-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- main
paths:
- 'content/**'
- .github/workflows/test-changed-content.yml

permissions:
contents: read
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/validate-asset-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
pull_request:
paths:
- 'assets/**'
- '.github/workflows/validate-asset-images.yml'

permissions:
contents: read
Expand All @@ -24,4 +25,4 @@ jobs:
- uses: ./.github/actions/node-npm-setup

- name: Validate all asset images
run: tsx src/assets/scripts/validate-asset-images.ts
run: npm run validate-asset-images
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you're interested in creating an app for {% data variables.product.prodname_m

### {% data variables.product.prodname_copilot_extensions %}

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% data reusables.copilot.copilot-extensions.copilot-extensions-intro %}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
title: Automating usage reporting with the REST API
intro: Learn how to automate reporting on your use of paid features using the REST API.
allowTitleToDifferFromFilename: true
shortTitle: Automate usage reporting
versions:
ghec: '*'
type: how_to
topics:
- Enterprise
- Billing
- REST
permissions: 'Enterprise owners and billing managers'
product: '{% data reusables.billing.enhanced-billing-platform-product %}'
---

You can automatically pull data from {% data variables.product.github %} to populate the business systems you use to monitor costs and usage using the REST API. If you haven't used the {% data variables.product.github %} REST API before, the following articles are a good starting point, see "[AUTOTITLE](/rest/using-the-rest-api).

## Using the billing platform `/usage` endpoint to retrieve metered usage details for an enterprise

The enhanced billing platform provides a single REST API `/usage` endpoint that you can use to report on the use of all metered products. The usage data provided by this endpoint is available only to enterprise owners and enterprise billing managers, so you will need to authenticate with {% data variables.product.github %}.

* If you use the GitHub CLI, use the `gh auth login` command to authenticate.
* Otherwise, you will need to create a {% data variables.product.pat_v1 %}, see "[Creating a {% data variables.product.pat_v1 %}](/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)."

When you call the `/usage` endpoint, you must specify the enterprise that you want data for and, by default, usage for the current year that does not belong to a cost center is reported. You can reduce the scope of data returned by the endpoint using query parameters.

* Define a specific time period by setting one or more of the following parameters: `year`, `month`, `day`, and `hour`.
* Define a cost center to report on by identifier using the `cost_center_id` query parameter.

For more detailed information and an example call and response, see [Get billing usage report for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-billing-usage-report-for-an-enterprise).

<!-- expires 2025-07-01 -->
## Migrating from the endpoints used for the previous billing platform

The previous billing platform provided three different endpoints for usage data:

* [Get GitHub Actions billing for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-github-actions-billing-for-an-enterprise)
* [Get GitHub Packages billing for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-github-packages-billing-for-an-enterprise)
* [Get shared storage billing for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-shared-storage-billing-for-an-enterprise)

When you transition to the enhanced billing platform, these endpoints will no longer return accurate usage information. You should upgrade any automation that uses these endpoints to use the new endpoint [GET /enterprises/{enterprise}/settings/billing/usage](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-billing-usage-report-for-an-enterprise). The tables below provide a detailed explanation how to use the billing platform to retrieve equivalent information.

### Changes in call definition

If you used a {% data variables.product.pat_v2 %} to authenticate with the previous endpoints, you will need create a {% data variables.product.pat_v1 %} to authenticate with the new endpoint.

In addition, you may want to use the new query parameters to specify a time period or cost center.

### Getting GitHub Actions billing data from the new response data

Example of the previous response

```json
{"total_minutes_used": 305, "total_paid_minutes_used": 0, "included_minutes": 3000, "minutes_used_breakdown": { "UBUNTU": 205, "MACOS": 10, "WINDOWS": 90 } }
```

Example of the new response

```json
{ "usageItems": [ { "date": "2023-08-01", "product": "Actions", "sku": "Actions Linux", "quantity": 100, "unitType": "minutes", "pricePerUnit": 0.008, "grossAmount": 0.8, "discountAmount": 0, "netAmount": 0.8, "organizationName": "GitHub", "repositoryName": "github/example"} ] }
```

To get the same values from the new response data:

{% rowheaders %}

| Previous property | Calculate from new API response |
|------ |----------- |
| `total_minutes_used` | <ul><li>Filter results by `"product": "Actions"` and `"unitType": "minutes"`</li><li>Sum `quantity`</li></ul>|
| `total_paid_minutes_used`| This is now represented as a $ amount via `netAmount`.<ul><li>Filter results by `"product": "Actions"` and `"unitType": "minutes"`</li><li>Sum `netAmount`</li></ul>|
| `included_minutes` | This is now represented as a $ amount via `discountAmount`.<ul><li>Filter results by `"product": "Actions"` and `"unitType": "minutes"`</li><li>Sum `discountAmount`</li></ul>|
| `minutes_used_breakdown` | <ul><li>Filter results by `"product": "Actions"` and `"unitType": "minutes"`</li><li>Sum `quantity` grouped by `sku`</li></ul>|

{% endrowheaders %}

### Getting GitHub Packages billing data from the new response data

Example of the previous response

```json
{ "total_gigabytes_bandwidth_used": 50, "total_paid_gigabytes_bandwidth_used": 40, "included_gigabytes_bandwidth": 10 }
```

Example of the new response

```json
{ "usageItems": [ { "date": "2023-08-01", "product": "Packages", "sku": "Packages data transfer", "quantity": 100, "unitType": "gigabytes", "pricePerUnit": 0.008, "grossAmount": 0.8, "discountAmount": 0, "netAmount": 0.8, "organizationName": "GitHub", "repositoryName": "github/example" } ] }
```

{% rowheaders %}

| Previous property | Calculate from new API response |
|------ |----------- |
| `total_gigabytes_bandwidth_used` | <ul><li>Filter results by `"product": "Packages"` and `"unitType": "gigabytes"` </li><li>Sum `quantity`</li></ul> |
| `total_paid_gigabytes_bandwidth_used`| This is now represented as a $ amount via `netAmount`. <ul><li>Filter results by `"product": "Packages"` and `"unitType": "gigabytes"`</li><li>Sum `netAmount`</li></ul> |
| `included_gigabytes_bandwidth` | This is now represented as a $ amount via `discountAmount`.<ul><li>Filter results by `"product": "Packages"` and `"unitType": "gigabytes"`</li><li>Sum `discountAmount`</li></ul> |

{% endrowheaders %}

### Getting shared storage billing from the new response data

Example of the previous response

```json
{ "days_left_in_billing_cycle": 20, "estimated_paid_storage_for_month": 15, "estimated_storage_for_month": 40 }
```

Example of the new response

```json
{ "usageItems": [ { "date": "2023-08-01", "product": "Packages", "sku": "Packages storage", "quantity": 100, "unitType": "GigabyteHours", "pricePerUnit": 0.008, "grossAmount": 0.8, "discountAmount": 0, "netAmount": 0.8, "organizationName": "GitHub", "repositoryName": "github/example" } ] }
```

{% rowheaders %}

| Previous property | Calculate from new API response |
|------ |----------- |
| `days_left_in_billing_cycle` | Not available. This information can be inferred by subtracting the current day of the month from the number of days in the current month. |
| `estimated_paid_storage_for_month`| This is now represented as a $ amount via `netAmount`. <br><br> Prerequisite: pass the `month` and `year` query parameters. <br><br> <i> For Actions storage </i> <ul><li> Filter results by `"product": "Actions"` and `"unitType": "GigabyteHours"`</li><li> Sum `netAmount`</li></ul> <i> For Packages storage </i> <ul><li> Filter results by `"product": "Packages"` and `"unitType": "GigabyteHours"`</li><li> Sum `netAmount`</li></ul>|
| `estimated_storage_for_month` | Prerequisite: pass the `month` and `year` query parameters. <br><br> <i> For Actions storage </i> <ul><li> Filter results by `"product": "Actions"` and `"unitType": "GigabyteHours"`</li><li> Sum `quantity`</li></ul> <i> For Packages storage </i> <ul><li> Filter results by `"product": "Packages"` and `"unitType": "GigabyteHours"`</li><li> Sum `quantity`</li></ul>|

{% endrowheaders %}

<!-- end expires 2025-07-01 -->
1 change: 1 addition & 0 deletions content/billing/using-the-new-billing-platform/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ children:
- /charging-business-units
- /preventing-overspending
- /managing-your-payment-and-billing-information
- /automating-usage-reporting
- /about-billing-for-git-large-file-storage
---
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ import (
)

func main() {
payload := `[{"token":"some_token","type":"some_type","url":"some_url","source":"some_source"}]`
payload := `[{"source":"commit","token":"some_token","type":"some_type","url":"https://example.com/base-repo-url/"}]`

kID := "f9525bf080f75b3506ca1ead061add62b8633a346606dc5fe544e29231c6ee0d"
kID := "bcb53661c06b4728e59d897fb6165d5c9cda0fd9cdf9d09ead458168deb7518c"

kSig := "MEUCIFLZzeK++IhS+y276SRk2Pe5LfDrfvTXu6iwKKcFGCrvAiEAhHN2kDOhy2I6eGkOFmxNkOJ+L2y8oQ9A2T9GGJo6WJY="
kSig := "MEQCIQDaMKqrGnE27S0kgMrEK0eYBmyG0LeZismAEz/BgZyt7AIfXt9fErtRS4XaeSt/AO1RtBY66YcAdjxji410VQV4xg=="

// Fetch the list of GitHub Public Keys
req, err := http.NewRequest("GET", "https://api.github.com/meta/public_keys/secret_scanning", nil)
Expand Down Expand Up @@ -284,14 +284,14 @@ require 'json'
require 'base64'

payload = <<-EOL
[{"token":"some_token","type":"some_type","url":"some_url","source":"some_source"}]
[{"source":"commit","token":"some_token","type":"some_type","url":"https://example.com/base-repo-url/"}]
EOL

payload = payload

signature = "MEUCIFLZzeK++IhS+y276SRk2Pe5LfDrfvTXu6iwKKcFGCrvAiEAhHN2kDOhy2I6eGkOFmxNkOJ+L2y8oQ9A2T9GGJo6WJY="
signature = "MEQCIQDaMKqrGnE27S0kgMrEK0eYBmyG0LeZismAEz/BgZyt7AIfXt9fErtRS4XaeSt/AO1RtBY66YcAdjxji410VQV4xg=="

key_id = "f9525bf080f75b3506ca1ead061add62b8633a346606dc5fe544e29231c6ee0d"
key_id = "bcb53661c06b4728e59d897fb6165d5c9cda0fd9cdf9d09ead458168deb7518c"

url = URI.parse('https://api.github.com/meta/public_keys/secret_scanning')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: About building Extensions
type: overview
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## About {% data variables.product.prodname_copilot_extensions_short %}

Expand Down Expand Up @@ -45,6 +45,12 @@ type: overview
* Integrate their tool into the developer workflow on {% data variables.product.company_short %} and the IDE
* Leverage the {% data variables.product.company_short %} ecosystem to raise awareness for their product

### About skillsets and agents

{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-1 %}
For more information about skillsets, see "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-skillset-for-your-copilot-extension/about-copilot-skillsets)."
{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-2 %}

### Resources for building {% data variables.product.prodname_copilot_extensions %}

{% data variables.product.company_short %} provides a comprehensive toolkit for extension builders, with code samples, a CLI debugging tool, quickstart SDKs, and a user feedback repository. For more information, see the [copilot-extensions](https://github.com/orgs/copilot-extensions/) organization on {% data variables.product.company_short %}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: About Copilot agents
type: overview
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% data variables.product.prodname_copilot_agents_short %} are custom tools embedded in {% data variables.product.prodname_copilot_extensions_short %}. They integrate with {% data variables.product.prodname_copilot_chat_short %} to provide additional functionalities tailored to specific needs. {% data variables.product.prodname_copilot_agents_short %} can perform various tasks such as querying documentation, retrieving data, executing specific actions, or providing AI-assisted coding suggestions. They enhance the capabilities of {% data variables.product.prodname_copilot %} by allowing developers to build and integrate custom features directly into the {% data variables.product.prodname_copilot_chat_short %} interface.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: Communicate with GitHub
type: reference
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## Prerequisites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: reference
layout: inline
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% data variables.product.prodname_copilot_agents_short %} communicate with the {% data variables.product.prodname_copilot_short %} platform in the form of server-sent events (SSEs). Rather than waiting for the {% data variables.product.prodname_copilot_short %} platform to request an update from your agent, or vice versa, you can use SSEs to send and receive updates to and from the platform in real time.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: reference
allowTitleToDifferFromFilename: true
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## About {% data variables.product.prodname_copilot_short %}'s Language Learning Model (LLM)

Expand Down
Loading

0 comments on commit 4557882

Please sign in to comment.