Skip to content

Commit 801887b

Browse files
authored
Merge pull request #39992 from github/repo-sync
Repo sync
2 parents a8c66fd + 5d8710e commit 801887b

File tree

5 files changed

+147
-5
lines changed

5 files changed

+147
-5
lines changed

content/actions/tutorials/authenticate-with-github_token.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070

7171
Use the `permissions` key in your workflow file to modify permissions for the `GITHUB_TOKEN` for an entire workflow or for individual jobs. This allows you to configure the minimum required permissions for a workflow or job. As a good security practice, you should grant the `GITHUB_TOKEN` the least required access.
7272

73+
To see the list of permissions available for use and their parameterized names, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#account-permissions).
74+
7375
The two workflow examples earlier in this article show the `permissions` key being used at the job level.
7476

7577
## Granting additional permissions

content/apps/sharing-github-apps/registering-a-github-app-from-a-manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The person registering the app will be redirected to a {% data variables.product
6767
`description` | `string` | A description of the {% data variables.product.prodname_github_app %}.
6868
`public` | `boolean` | Set to `true` when your {% data variables.product.prodname_github_app %} is available to the public or `false` when it is only accessible to the owner of the app.
6969
`default_events` | `array` | The list of [events](/webhooks-and-events/webhooks/webhook-events-and-payloads) the {% data variables.product.prodname_github_app %} subscribes to.
70-
`default_permissions` | `object` | The set of permissions needed by the {% data variables.product.prodname_github_app %}. The format of the object uses the permission name for the key (for example, `issues`) and the access type for the value (for example, `write`). For more information, see [AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app).
70+
`default_permissions` | `object` | The set of permissions needed by the {% data variables.product.prodname_github_app %}. The format of the object uses the permission name for the key (for example, `issues`) and the access type for the value (for example, `write`). For more information, see [AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app). To see the list of permissions available for use and their parameterized names, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#account-permissions).
7171
`request_oauth_on_install` | `boolean` | Set to `true` to request the user to authorize the {% data variables.product.prodname_github_app %}, after the {% data variables.product.prodname_github_app %} is installed.
7272
`setup_on_update` | `boolean` | Set to `true` to redirect users to the `setup_url` after they update your {% data variables.product.prodname_github_app %} installation.
7373

content/apps/sharing-github-apps/registering-a-github-app-using-url-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ For example, to select "Read & write" permissions in the user interface for `con
7474

7575
If the owning account is not an enterprise or an enterprise-owned organization, it cannot request enterprise permissions.{% endif %}
7676

77-
For more information about permissions and {% data variables.product.prodname_github_apps %}, see [AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app).
77+
For more information about permissions and {% data variables.product.prodname_github_apps %}, see [AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app). To see the list of permissions available for use and their parameterized names, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#account-permissions).
7878

7979
## {% data variables.product.prodname_github_app %} webhook events
8080

content/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,146 @@ For more information about best practices, see [AUTOTITLE](/rest/overview/keepin
118118

119119
If you selected an organization as the resource owner and the organization requires approval for {% data variables.product.pat_v2 %}s, then your token will be marked as `pending` until it is reviewed by an organization administrator. Your token will only be able to read public resources until it is approved. If you are an owner of the organization, your request is automatically approved. For more information, see [AUTOTITLE](/organizations/managing-programmatic-access-to-your-organization/reviewing-and-revoking-personal-access-tokens-in-your-organization).
120120

121+
### Pre-filling {% data variables.product.pat_v2 %} details using URL parameters
122+
123+
You can share templates for a {% data variables.product.pat_v2 %} via links. Storing token details this way makes it easier to automate workflows and improve your developer experience by directing users to token creation with relevant fields already completed.
124+
125+
Each supported field can be set using a specific query parameter. All parameters are optional and validated by the token generation form to ensure that the combinations of permissions and resource owner makes sense.
126+
127+
An example URL template is shown here, with line breaks for legibility:
128+
129+
```http copy
130+
https://github.com/settings/personal-access-tokens/new
131+
?name=Repo-reading+token
132+
&description=Just+contents:read
133+
&target_name=octodemo
134+
&expires_in=45
135+
&contents=read
136+
```
137+
138+
Try the URL to create a token with `contents:read` and `metadata:read`, with the given name and description and an expiration date 45 days in the future. You'll see an error message indicating `Cannot find the specified resource owner: octodemo` because you're not a member of the `octodemo` organization.
139+
140+
Below are some example URLs that generate the tokens we see most often:
141+
142+
* [Read repo contents](https://github.com/settings/personal-access-tokens/new?name=Repo-reading+token&description=Just+contents:read&contents=read)
143+
* [Push access to repos](https://github.com/settings/personal-access-tokens/new?name=Repo-writing+token&description=Just+contents:write&contents=write)
144+
* [GitHub Models access](https://github.com/settings/personal-access-tokens/new?name=GitHub+Models+token&description=Used%20to%20call%20GitHub%20Models%20APIs%20to%20easily%20run%20LLMs%3A%20https%3A%2F%2Fdocs.github.com%2Fgithub-models%2Fquickstart%23step-2-make-an-api-call&user_models=read)<!-- markdownlint-disable-line search-replace Custom rule -->
145+
* [Update code and open a PR](https://github.com/settings/personal-access-tokens/new?name=Core-loop+token&description=Write%20code%20and%20push%20it%20to%20main%21%20Includes%20permission%20to%20edit%20workflow%20files%20for%20Actions%20-%20remove%20%60workflows%3Awrite%60%20if%20you%20don%27t%20need%20to%20do%20that&contents=write&pull_requests=write&workflows=write)
146+
* [Manage Copilot licenses in an organization](https://github.com/settings/personal-access-tokens/new?name=Core-loop+token&description=Enable%20or%20disable%20copilot%20access%20for%20users%20with%20the%20Seat%20Management%20APIs%3A%20https%3A%2F%2Fdocs.github.com%2Frest%2Fcopilot%2Fcopilot-user-management%0ABe%20sure%20to%20select%20an%20organization%20for%20your%20resource%20owner%20below%21&organization_copilot_seat_management=write)<!-- markdownlint-disable-line search-replace Custom rule -->
147+
148+
#### Supported Query Parameters
149+
150+
To create your own token template, follow the query parameter details provided in this table:
151+
152+
| Parameter | Type | Example Value | Valid Values | Description |
153+
|----------------|--------|------------------|--------------|-----------------------|
154+
| `name` | string | `Deploy%20Bot` | ≤ 40 characters, URL-encoded | Pre-fills the token’s display name. |
155+
| `description` | string | `Used+for+deployments` | ≤ 1024 chars, URL-encoded | Pre-fills the description for the token. |
156+
| `target_name` | string | `octodemo` | User or organization slug | Sets the token's resource target. This is the owner of the repositories that the token will be able to access. If not provided, defaults to the current user's account. |
157+
| `expires_in` | integer| `30` or `none` | Integer between 1 and 366, or `none` | Days until expiration or `none` for non-expiring. If not provided, the default is 30 days, or less if the target has a token lifetime policy set. |
158+
| `<permission>` | string | `contents=read` | A series of permission and access levels. | The permissions the token should have. Permissions can be set to `read`, `write`, or `admin`, but not every permission supports each of those levels. |
159+
160+
#### Permissions
161+
162+
Each supported permission is set using its name as a query parameter, with the value specifying the desired access level. Valid access levels are `read`, `write`, and `admin`. Some permissions only support `read`, some only support `write`, and only a few have `admin`. Use as many permissions as needed, in the form `&contents=read&pull_requests=write&...`.
163+
164+
You do not need to include both `read` and `write` for a permission in your URL—`write` always includes `read`, and `admin` always includes `write`.
165+
166+
##### Account Permissions
167+
168+
Account permissions are only used when the current user is set as the resource owner.
169+
170+
| Parameter name | Display name | Access levels |
171+
|---|---|---|
172+
| `blocking` | Block another user | `read`, `write` |
173+
| `codespaces_user_secrets` | Codespaces user secrets | `read`, `write` |
174+
| `copilot_messages` | Copilot Chat | `read` |
175+
| `copilot_editor_context` | Copilot Editor Context | `read` |
176+
| `emails` | Email addresses | `read`, `write` |
177+
| `user_events` | Events | `read` |
178+
| `followers` | Followers | `read`, `write` |
179+
| `gpg_keys` | GPG keys | `read`, `write` |
180+
| `gists` | Gists | `write` |
181+
| `keys` | Git SSH keys | `read`, `write` |
182+
| `interaction_limits` | Interaction limits | `read`, `write` |
183+
| `knowledge_bases` | Knowledge bases | `read`, `write` |
184+
| `user_models` | Models | `read` |
185+
| `plan` | Plan | `read` |
186+
| `private_repository_invitations` | Private repository invitations | `read` |
187+
| `profile` | Profile | `write` |
188+
| `git_signing_ssh_public_keys` | SSH signing keys | `read`, `write` |
189+
| `starring` | Starring | `read`, `write` |
190+
| `watching` | Watching | `read`, `write` |
191+
192+
##### Repository Permissions
193+
194+
Repository permissions work for both user and organization resource owners.
195+
196+
| Parameter name | Display name | Access levels |
197+
|---|---|---|
198+
| `actions` | Actions | `read`, `write` |
199+
| `administration` | Administration | `read`, `write` |
200+
| `attestations` | Attestations | `read`, `write` |
201+
| `security_events` | Code scanning alerts | `read`, `write` |
202+
| `codespaces` | Codespaces | `read`, `write` |
203+
| `codespaces_lifecycle_admin` | Codespaces lifecycle admin | `read`, `write` |
204+
| `codespaces_metadata` | Codespaces metadata | `read` |
205+
| `codespaces_secrets` | Codespaces secrets | `write` |
206+
| `statuses` | Commit statuses | `read`, `write` |
207+
| `contents` | Contents | `read`, `write` |
208+
| `repository_custom_properties` | Custom properties | `read`, `write` |
209+
| `vulnerability_alerts` | Dependabot alerts | `read`, `write` |
210+
| `dependabot_secrets` | Dependabot secrets | `read`, `write` |
211+
| `deployments` | Deployments | `read`, `write` |
212+
| `discussions` | Discussions | `read`, `write` |
213+
| `environments` | Environments | `read`, `write` |
214+
| `issues` | Issues | `read`, `write` |
215+
| `merge_queues` | Merge queues | `read`, `write` |
216+
| `metadata` | Metadata | `read` |
217+
| `pages` | Pages | `read`, `write` |
218+
| `pull_requests` | Pull requests | `read`, `write` |
219+
| `repository_advisories` | Repository security advisories | `read`, `write` |
220+
| `secret_scanning_alerts` | Secret scanning alerts | `read`, `write` |
221+
| `secrets` | Secrets | `read`, `write` |
222+
| `actions_variables` | Variables | `read`, `write` |
223+
| `repository_hooks` | Webhooks | `read`, `write` |
224+
| `workflows` | Workflows | `write` |
225+
226+
##### Organization Permissions
227+
228+
Organization permissions can only be used if the resource owner is an organization.
229+
230+
| Parameter name | Display name | Access levels |
231+
|---|---|---|
232+
| `organization_api_insights` | API Insights | `read` |
233+
| `organization_administration` | Administration | `read`, `write` |
234+
| `organization_user_blocking` | Blocking users | `read`, `write` |
235+
| `organization_campaigns` | Campaigns | `read`, `write` |
236+
| `organization_custom_org_roles` | Custom organization roles | `read`, `write` |
237+
| `organization_custom_properties` | Custom repository properties | `read`, `write`, `admin` |
238+
| `organization_custom_roles` | Custom repository roles | `read`, `write` |
239+
| `organization_events` | Events | `read` |
240+
| `organization_copilot_seat_management` | GitHub Copilot Business | `read`, `write` |
241+
| `issue_types` | Issue Types | `read`, `write` |
242+
| `organization_knowledge_bases` | Knowledge bases | `read`, `write` |
243+
| `members` | Members | `read`, `write` |
244+
| `organization_models` | Models | `read` |
245+
| `organization_network_configurations` | Network configurations | `read`, `write` |
246+
| `organization_announcement_banners` | Organization announcement banners | `read`, `write` |
247+
| `organization_codespaces` | Organization codespaces | `read`, `write` |
248+
| `organization_codespaces_secrets` | Organization codespaces secrets | `read`, `write` |
249+
| `organization_codespaces_settings` | Organization codespaces settings | `read`, `write` |
250+
| `organization_dependabot_secrets` | Organization dependabot secrets | `read`, `write` |
251+
| `organization_code_scanning_dismissal_requests` | Code scanning dismissal requests | `read`, `write` |
252+
| `organization_private_registries` | Private registries | `read`, `write` |
253+
| `organization_plan` | Plan | `read` |
254+
| `organization_projects` | Projects | `read`, `write`, `admin` |
255+
| `organization_secrets` | Secrets | `read`, `write` |
256+
| `organization_self_hosted_runners` | Self-hosted runners | `read`, `write` |
257+
| `team_discussions` | Team discussions | `read`, `write` |
258+
| `organization_actions_variables` | Variables | `read`, `write` |
259+
| `organization_hooks` | Webhooks | `read`, `write` |
260+
121261
## Creating a {% data variables.product.pat_v1 %}
122262

123263
> [!NOTE]

content/copilot/tutorials/roll-out-at-scale/measure-adoption/analyze-usage-over-time.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can use the [AUTOTITLE](/rest/copilot/copilot-metrics) to see trends in how
2525

2626
The API includes:
2727

28-
* Data for the last 28 days
28+
* Data for the last 100 days
2929
* Numbers of active users and engaged users
3030
* Breakdowns by language and IDE
3131
* The option to view metrics for an enterprise, organization, or team
@@ -125,7 +125,7 @@ In your terminal, you should see output with a JSON array like the following.
125125

126126
## 3. Store the data
127127

128-
To analyze trends over longer than 28 days, you will need to:
128+
To analyze trends over longer than 100 days, you will need to:
129129

130130
* Call the API daily, using a cron job or scheduled {% data variables.product.prodname_actions %} workflow.
131131
* Store data locally or with a database service such as MySQL.
@@ -208,7 +208,7 @@ If you run the script again tomorrow, it should only save data for one new day t
208208
209209
## 4. Analyze trends
210210
211-
You can work with the data from the API to identify trends over the last 28 days or, if you've stored data from previous API calls, over a longer period.
211+
You can work with the data from the API to identify trends over the last 100 days or, if you've stored data from previous API calls, over a longer period.
212212
213213
### Example
214214

0 commit comments

Comments
 (0)