You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// An error will be thrown if the user is not a GitHub employee
46
47
// 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
47
48
48
-
if (titleWordCount >= titleWordCountMin && !titleHasUrl) {
49
+
if (titleWordCount >= titleWordCountMin && !titleHasUrl && !titleHasDollarSign) {
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.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-cli/automate-copilot-cli/schedule-prompts.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ The prompt fires once, after the delay has elapsed, and is then removed from the
73
73
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.
74
74
75
75
> [!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.
77
77
78
78
### Examples
79
79
@@ -94,9 +94,11 @@ You can use `/every` and `/after` to schedule a skill. To do this, you can refer
94
94
|`h`| hours |`2h`|
95
95
|`d`| days |`1d`|
96
96
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.
98
98
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.
100
102
101
103
## Identifying scheduled prompts in the session
102
104
@@ -116,9 +118,9 @@ Press <kbd>Esc</kbd> to exit the schedule list.
116
118
117
119
Scheduled prompts are scoped to the session they were created in, and they are only triggered while that session is running.
118
120
119
-
When you reopen the session (using the `--continue` or `--resume` command line options) the schedules are restarted, with intervalbefore 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.
120
122
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.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md
+40-15Lines changed: 40 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ If you use your own LLM provider API keys (BYOK), {% data variables.product.gith
18
18
19
19
Authentication is required for any other {% data variables.copilot.copilot_cli %} usage.
20
20
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.
22
22
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).
24
24
***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).
25
25
***{% 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).
26
26
@@ -52,7 +52,7 @@ Offline mode is **only fully air-gapped** if your BYOK provider is local or othe
| OAuth token (browser or device flow) |`gho_`| Yes | Default method via `copilot login`|
56
56
| 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 |
| 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
78
78
1. GitHub CLI (`gh auth token`) fallback
79
79
80
80
> [!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.
82
82
> * 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.
83
83
84
84
## Authenticating with OAuth
85
85
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.
87
87
88
88
### Authenticate with `/login`
89
89
@@ -101,16 +101,28 @@ The OAuth device flow is the default authentication method for interactive use.
101
101
2. {% data variables.product.prodname_ghe_cloud %} with data residency (*.ghe.com)
102
102
```
103
103
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:
105
105
106
106
```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
110
110
```
111
111
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
+
114
126
1. If your organization uses SAML SSO, click **Authorize** next to each organization you want to grant access to.
115
127
1. Review the requested permissions and click **Authorize GitHub Copilot CLI**.
116
128
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.
133
145
copilot login --host HOSTNAME
134
146
```
135
147
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.
137
160
138
161
```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...
140
164
```
141
165
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.
144
169
1. If your organization uses SAML SSO, click **Authorize** next to each organization you want to grant access to.
145
170
1. Review the requested permissions and click **Authorize GitHub Copilot CLI**.
146
171
1. Return to your terminal. The CLI displays a success message when authentication is complete.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ If you are using an environment variable, check whether the `COPILOT_GITHUB_TOKE
62
62
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).
63
63
64
64
```bash copy
65
-
export$COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN
65
+
export COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN
66
66
```
67
67
68
68
#### macOS keychain
@@ -106,7 +106,31 @@ Review the token's status and permissions on {% data variables.product.prodname_
106
106
107
107
## {% data variables.product.pat_classic_caps %} rejected
108
108
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
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-cli/use-copilot-cli-in-actions.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,19 +50,22 @@ jobs:
50
50
runs-on: ubuntu-latest
51
51
steps:
52
52
- uses: {% data reusables.actions.action-checkout %}
53
+
with:
54
+
fetch-depth: 2
53
55
- name: Install Copilot CLI
54
56
run: npm install -g @github/copilot
55
57
- 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:*)'
57
59
env:
58
60
GITHUB_TOKEN: {% raw %}${{ github.token }}{% endraw %}
59
61
```
60
62
61
63
Key details about this example:
62
64
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.
64
67
* 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.
66
69
67
70
> [!NOTE]
68
71
> 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