Skip to content

Commit 70779d3

Browse files
authored
Merge pull request #45792 from github/repo-sync
Repo sync
2 parents 062800c + 3bc1b44 commit 70779d3

18 files changed

Lines changed: 1045 additions & 39 deletions

File tree

.github/agents/dependabot-ecosystem-update.md

Lines changed: 634 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/check-for-spammy-issues.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
const titleWordCountMin = 3
3131
const urlRegex = /https?:\/\/\S+/i
3232
const titleHasUrl = urlRegex.test(issue.title)
33+
const titleHasDollarSign = issue.title.includes('$')
3334
3435
try {
3536
await github.rest.teams.getMembershipForUserInOrg({
@@ -45,7 +46,7 @@ jobs:
4546
// An error will be thrown if the user is not a GitHub employee
4647
// If a user is not a GitHub employee, we should check to see if title has at least the minimum required number of words in it and if it does, we can exit the workflow
4748
48-
if (titleWordCount >= titleWordCountMin && !titleHasUrl) {
49+
if (titleWordCount >= titleWordCountMin && !titleHasUrl && !titleHasDollarSign) {
4950
return
5051
}
5152
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Add new issues and PRs to central triage board
2+
3+
# **What it does**: Adds newly opened or reopened issues and pull requests in github/docs to the right place for triage, and stamps the item with today's date.
4+
# **Why we have it**: To ensure incoming work in the public docs repo is triaged properly.
5+
# **Who does it impact**: Writers, FRs.
6+
7+
on:
8+
issues:
9+
types: [opened, reopened]
10+
pull_request_target:
11+
types: [opened, reopened, ready_for_review]
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
add-to-central-triage:
18+
runs-on: ubuntu-latest
19+
if: github.repository == 'github/docs'
20+
steps:
21+
- name: Triage to central triage board
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
24+
ITEM_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
25+
# Add to the Central Triage Group project board and set date to now
26+
PROJECT_NUMBER: '19598'
27+
PROJECT_ID: 'PVT_kwDNJr_OAJ4AfQ'
28+
DATE_FIELD_ID: 'PVTF_lADNJr_OAJ4Afc4IAbbv'
29+
run: |
30+
echo "Adding $ITEM_URL to project $PROJECT_NUMBER..."
31+
ITEM_ID=$(gh project item-add "$PROJECT_NUMBER" --owner github --url "$ITEM_URL" --format json --jq '.id' || true)
32+
33+
sleep 10
34+
35+
if [ -n "$ITEM_ID" ] && [ "$ITEM_ID" != "null" ]; then
36+
echo "Editing date on item $ITEM_ID..."
37+
DATE=$(date '+%Y-%m-%d')
38+
if gh project item-edit --project-id "$PROJECT_ID" --id "$ITEM_ID" --field-id "$DATE_FIELD_ID" --date "$DATE"; then
39+
echo "done editing"
40+
else
41+
echo "::warning::gh project item-edit failed for $ITEM_URL (item $ITEM_ID); the item is on the board but the date field was not set"
42+
fi
43+
else
44+
echo "::warning::gh project item-add did not return an item id for $ITEM_URL; skipping item-edit"
45+
fi

content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You can start a {% data variables.copilot.copilot_cli_short %} session inside an
8080
To start a cloud-backed session, run:
8181

8282
```bash copy
83-
copilot ‑‑cloud
83+
copilot --cloud
8484
```
8585

8686
## Use cases for {% data variables.copilot.copilot_cli %}

content/copilot/how-tos/copilot-cli/automate-copilot-cli/schedule-prompts.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The prompt fires once, after the delay has elapsed, and is then removed from the
7373
You can use `/every` and `/after` to schedule a skill. To do this, you can reference the skill explicitly by using its slash command, or you can use natural language to tell {% data variables.product.prodname_copilot_short %} to run the skill.
7474

7575
> [!NOTE]
76-
> Only user-invocable skills can be scheduled this way. You cannot include built-in slash commands (such as `/clear`) in a scheduled prompt.
76+
> Only user-invocable skills and a subset of built-in slash commands can be scheduled. Commands that start a self-contained piece of work—such as `/plan`, `/review`, `/research`, or `/security-review`—are schedulable. Commands that change your session or configuration (for example, `/model`, `/clear`, `/compact`, `/permissions`, or `/sandbox`), that only display information (such as `/usage` or `/context`), or that manage scheduling itself (`/every` and `/after`) can't be scheduled, and {% data variables.product.prodname_copilot_short %} rejects them when you try.
7777
7878
### Examples
7979

@@ -94,9 +94,11 @@ You can use `/every` and `/after` to schedule a skill. To do this, you can refer
9494
| `h` | hours | `2h` |
9595
| `d` | days | `1d` |
9696

97-
A bare number with no suffix is interpreted as minutes—for example, `/every 30 remind me to check for Slack messages` schedules the prompt every 30 minutes.
97+
When you specify a numeric duration, always include the suffix. A bare number—for example, `/every 30 remind me to check for Slack messages`—is not recognized as an interval.
9898

99-
The minimum interval is **10 seconds** and the maximum is **1 day** (24 hours).
99+
For a fixed interval, the minimum is **10 seconds** and the maximum is **1 day** (24 hours).
100+
101+
You can also describe the timing in plain language instead of using a duration—for example, `/after at 3pm push the release`, or `/every day at 9am post the standup`. {% data variables.product.prodname_copilot_short %} uses a model to interpret the phrase, then creates the schedule from it.
100102

101103
## Identifying scheduled prompts in the session
102104

@@ -116,9 +118,9 @@ Press <kbd>Esc</kbd> to exit the schedule list.
116118

117119
Scheduled prompts are scoped to the session they were created in, and they are only triggered while that session is running.
118120

119-
When you reopen the session (using the `--continue` or `--resume` command line options) the schedules are restarted, with interval before a schedule is triggered measured from the moment you reopen the session.
121+
When you reopen the session (using the `--continue` or `--resume` command line options) the schedules are restored. For a recurring schedule created with a fixed interval, the wait before the next run is measured from the moment you reopen the session.
120122

121-
If an `/after` schedule had not been triggered before you closed the session, it remains in the schedule list and will be triggered after the specified delay in the reopened session.
123+
An `/after` schedule that had not been triggered before you closed the session keeps its original target time, rather than restarting the delay. If that time passed while the session was closed, the prompt is submitted as soon as you reopen the session.
122124

123125
## Running a prompt from an external scheduler
124126

content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ If you use your own LLM provider API keys (BYOK), {% data variables.product.gith
1818

1919
Authentication is required for any other {% data variables.copilot.copilot_cli %} usage.
2020

21-
When authentication is required, {% data variables.copilot.copilot_cli_short %} supports three methods. The method you use depends on whether you are working interactively or in an automated environment.
21+
When authentication is required, {% data variables.copilot.copilot_cli_short %} supports several methods. The method you use depends on whether you are working interactively or in an automated environment.
2222

23-
* **OAuth device flow**: The default and recommended method for interactive use. When you run `/login` in {% data variables.copilot.copilot_cli_short %}, the CLI generates a one-time code and directs you to authenticate in your browser. This is the simplest way to authenticate. See [Authenticating with OAuth](#authenticating-with-oauth).
23+
* **OAuth**: The default and recommended method for interactive use. There are two OAuth flows. The browser (web) flow opens your browser to authorize the sign-in and completes it on a local loopback callback. The device code flow displays a one-time code that you enter in your browser. The browser flow is the default on a local desktop, and known remote or headless environments (including SSH, {% data variables.product.prodname_github_codespaces %}, dev containers, and CI) default to the device code flow. See [Authenticating with OAuth](#authenticating-with-oauth).
2424
* **Environment variables**: Recommended for CI/CD pipelines, containers, and non-interactive environments. You set a supported token as an environment variable (`COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN`), and the CLI uses it automatically without prompting. See [Authenticating with environment variables](#authenticating-with-environment-variables).
2525
* **{% data variables.product.prodname_cli %} fallback**: If you have {% data variables.product.prodname_cli %} (`gh`) (note: the `gh` CLI, not `copilot`) installed and authenticated, {% data variables.copilot.copilot_cli_short %} can use its token automatically. This is the lowest priority method and activates only when no other credentials are found. See [Authenticating with {% data variables.product.prodname_cli %}](#authenticating-with-github-cli).
2626

@@ -52,7 +52,7 @@ Offline mode is **only fully air-gapped** if your BYOK provider is local or othe
5252

5353
| Token type | Prefix | Supported | Notes |
5454
|----------------------------|---------------|-----------|--------------------------------------------------------|
55-
| OAuth token (device flow) | `gho_` | Yes | Default method via `copilot login` |
55+
| OAuth token (browser or device flow) | `gho_` | Yes | Default method via `copilot login` |
5656
| Fine-grained PAT | `github_pat_` | Yes | Must be owned by your personal account (not an organization) with the **{% data variables.product.prodname_copilot_short %} Requests** account permission |
5757
| GitHub App user-to-server | `ghu_` | Yes | Via environment variable |
5858
| Classic PAT | `ghp_` | No | Not supported by {% data variables.copilot.copilot_cli_short %} |
@@ -78,12 +78,12 @@ When you run a command, {% data variables.copilot.copilot_cli_short %} checks fo
7878
1. GitHub CLI (`gh auth token`) fallback
7979

8080
> [!NOTE]
81-
> * An environment variable silently overrides a stored OAuth token. If you set `GH_TOKEN` for another tool, the CLI uses that token instead of the OAuth token from `copilot login`. To avoid unexpected behavior, unset environment variables you do not intend the CLI to use.
81+
> * An environment variable silently overrides a stored OAuth token. If you set `GH_TOKEN` for another tool, the CLI uses that token instead of the OAuth token from `copilot login`. To avoid unexpected behavior, unset environment variables you do not intend the CLI to use. There is one exception: in {% data variables.product.prodname_github_codespaces %}, the `GITHUB_TOKEN` that is injected automatically does not take precedence over an account you signed in with using `/login`. A `GITHUB_TOKEN`, `COPILOT_GITHUB_TOKEN`, or `GH_TOKEN` that you export explicitly still does.
8282
> * When you configure BYOK provider environment variables (for example, `COPILOT_PROVIDER_BASE_URL`, `COPILOT_PROVIDER_API_KEY`), {% data variables.copilot.copilot_cli_short %} uses these for AI model requests regardless of your {% data variables.product.github %} authentication status. {% data variables.product.github %} tokens are only needed for {% data variables.product.github %}-hosted features.
8383
8484
## Authenticating with OAuth
8585

86-
The OAuth device flow is the default authentication method for interactive use. You can authenticate by running `/login` from {% data variables.copilot.copilot_cli_short %} or `copilot login` from your terminal.
86+
OAuth is the default authentication method for interactive use. You can authenticate by running `/login` from {% data variables.copilot.copilot_cli_short %} or `copilot login` from your terminal. Both offer a browser (web) flow and a device code flow.
8787

8888
### Authenticate with `/login`
8989

@@ -101,16 +101,28 @@ The OAuth device flow is the default authentication method for interactive use.
101101
2. {% data variables.product.prodname_ghe_cloud %} with data residency (*.ghe.com)
102102
```
103103

104-
1. The CLI displays a one-time user code and automatically copies it to your clipboard and opens your browser.
104+
1. Choose how you want to sign in. The recommended option is listed first, and depends on your environment: the browser flow on a local terminal, or the device code flow in a remote or headless environment. The following example shows the prompt in a local terminal:
105105

106106
```text
107-
Waiting for authorization...
108-
Enter one-time code: 1234-5678 at https://github.com/login/device
109-
Press any key to copy to clipboard and open browser...
107+
How do you want to sign in?
108+
1. Sign in with your browser (recommended)
109+
2. Sign in with a device code
110110
```
111111

112-
1. Navigate to the verification URL at `https://github.com/login/device` if your browser did not open automatically.
113-
1. Paste the one-time code in the field on the page.
112+
1. Complete the flow you selected.
113+
114+
* **Browser**: {% data variables.copilot.copilot_cli_short %} opens your browser so that you can authorize the sign-in. If your browser does not open automatically, the terminal displays a URL that you can visit instead.
115+
116+
* **Device code**: The CLI displays a one-time user code, and can copy it to your clipboard and open your browser for you.
117+
118+
```text
119+
Waiting for authorization...
120+
Enter one-time code: 1234-5678 at https://github.com/login/device
121+
Press any key to copy to clipboard and open browser...
122+
```
123+
124+
Navigate to the verification URL at `https://github.com/login/device` if your browser did not open automatically, then paste the one-time code in the field on the page.
125+
114126
1. If your organization uses SAML SSO, click **Authorize** next to each organization you want to grant access to.
115127
1. Review the requested permissions and click **Authorize GitHub Copilot CLI**.
116128
1. Return to your terminal. The CLI displays a success message when authentication is complete.
@@ -133,14 +145,27 @@ The OAuth device flow is the default authentication method for interactive use.
133145
copilot login --host HOSTNAME
134146
```
135147

136-
The CLI displays a one-time user code and automatically copies it to your clipboard and opens your browser.
148+
1. Authorize the sign-in.
149+
150+
On a local desktop, `copilot login` uses the browser flow by default. It opens your browser to authorize the sign-in and captures the result on a local loopback callback.
151+
152+
```text
153+
Opening your browser to authenticate...
154+
If it doesn't open automatically, visit:
155+
URL
156+
Waiting for authorization...
157+
```
158+
159+
Known remote or headless environments (including SSH, {% data variables.product.prodname_github_codespaces %}, dev containers, and CI) use the device code flow instead. The CLI displays a one-time code and, when supported by the environment, can copy it to your clipboard and open a browser.
137160

138161
```text
139-
To authenticate, visit https://github.com/login/device and enter code 1234-5678.
162+
To authenticate, visit https://github.com/login/device and enter code 1234-5678
163+
Waiting for authorization...
140164
```
141165

142-
1. Navigate to the verification URL at `https://github.com/login/device` if your browser did not open automatically.
143-
1. Paste the one-time code in the field on the page.
166+
To force a particular flow, add the `--web-flow` or `--device-code` option.
167+
168+
1. Navigate to the URL displayed in your terminal if your browser did not open automatically. For the device code flow, paste the one-time code in the field on the page.
144169
1. If your organization uses SAML SSO, click **Authorize** next to each organization you want to grant access to.
145170
1. Review the requested permissions and click **Authorize GitHub Copilot CLI**.
146171
1. Return to your terminal. The CLI displays a success message when authentication is complete.

content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you are using an environment variable, check whether the `COPILOT_GITHUB_TOKE
6262
If the command prints nothing, the variable is not set. Set the variable to a valid token. To generate a token, see [AUTOTITLE](/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli#authenticating-with-environment-variables).
6363

6464
```bash copy
65-
export $COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN
65+
export COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN
6666
```
6767

6868
#### macOS keychain
@@ -106,7 +106,31 @@ Review the token's status and permissions on {% data variables.product.prodname_
106106

107107
## {% data variables.product.pat_classic_caps %} rejected
108108

109-
A token starting with `ghp_` is silently ignored and the CLI behaves as if no token is set.
109+
A token starting with `ghp_` is rejected. What happens next depends on how you are running {% data variables.copilot.copilot_cli_short %}.
110+
111+
In an interactive session, the classic {% data variables.product.pat_generic %} is ignored and the CLI keeps running, so you can authenticate another way, such as with `/login`. {% data variables.copilot.copilot_cli_short %} displays a warning like the following, naming the environment variable that holds the token:
112+
113+
<!-- markdownlint-disable GHD005 -->
114+
```text
115+
Classic Personal Access Tokens (ghp_) are not supported. GITHUB_TOKEN contains a classic PAT and will be ignored. Use /login to authenticate, or replace it with a fine-grained PAT.
116+
```
117+
<!-- markdownlint-enable GHD005 -->
118+
119+
In non-interactive use, such as `copilot -p` or other automation, if the classic {% data variables.product.pat_generic %} is the only credential available, the CLI refuses to start and displays the following error, naming the environment variable that holds the token:
120+
121+
<!-- markdownlint-disable GHD005 -->
122+
```text
123+
Error: Classic Personal Access Tokens (ghp_) are not supported by Copilot.
124+
125+
The GITHUB_TOKEN environment variable contains a classic PAT.
126+
Please use a Fine-Grained Personal Access Token or another authentication method.
127+
128+
To fix this, you can:
129+
• Replace the token in GITHUB_TOKEN with a fine-grained PAT
130+
• Unset GITHUB_TOKEN and run 'gh auth login' to authenticate
131+
• Unset GITHUB_TOKEN and start 'copilot', then use the '/login' command
132+
```
133+
<!-- markdownlint-enable GHD005 -->
110134

111135
### Cause
112136

content/copilot/how-tos/copilot-cli/use-copilot-cli-in-actions.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,22 @@ jobs:
5050
runs-on: ubuntu-latest
5151
steps:
5252
- uses: {% data reusables.actions.action-checkout %}
53+
with:
54+
fetch-depth: 2
5355
- name: Install Copilot CLI
5456
run: npm install -g @github/copilot
5557
- name: Run Copilot
56-
run: copilot --yolo -p "Summarize the changes in this commit"
58+
run: copilot -p "Use git show HEAD to summarize the changes in this commit" -s --allow-tool='shell(git show:*)'
5759
env:
5860
GITHUB_TOKEN: {% raw %}${{ github.token }}{% endraw %}
5961
```
6062
6163
Key details about this example:
6264
63-
* The `--yolo` flag automatically approves all tool, path, and URL permission requests. Non-interactive (`-p`) runs can't display an interactive approval prompt, so any action that isn't pre-approved is denied automatically. To grant only the permissions the task needs, use narrower options such as `--allow-tool`, `--add-dir`, and `--allow-url` instead.
65+
* The `fetch-depth: 2` option fetches the current commit and its parent, allowing `git show HEAD` to calculate the changes introduced by the current commit.
66+
* The `--allow-tool='shell(git show:*)'` option allows {% data variables.copilot.copilot_cli_short %} to run `git show` commands without requesting approval. Non-interactive (`-p`) runs can't display an interactive approval prompt, so any action that isn't pre-approved is denied automatically.
6467
* The `copilot-requests: write` permission is required for the workflow to make {% data variables.product.prodname_copilot_short %} requests.
65-
* The `GITHUB_TOKEN` provided by {% data variables.product.prodname_actions %} handles authentication automatically, no additional secrets are needed.
68+
* The `GITHUB_TOKEN` provided by {% data variables.product.prodname_actions %} handles authentication automatically. No additional secrets are needed.
6669

6770
> [!NOTE]
6871
> You must be on a recent version of {% data variables.copilot.copilot_cli_short %} to use `GITHUB_TOKEN` authentication. Update with `copilot update`, or reinstall the latest version with `npm install -g @github/copilot`.

0 commit comments

Comments
 (0)