diff --git a/.github/workflows/changelog-agent.yml b/.github/workflows/changelog-agent.yml index e3894303e0f3..71e73de5c3ae 100644 --- a/.github/workflows/changelog-agent.yml +++ b/.github/workflows/changelog-agent.yml @@ -420,14 +420,15 @@ jobs: uses: actions/ai-inference@2c43c91ae16266ca159d311430343c67a5ffa222 # v3 with: provider: copilot - # No model is pinned: actions/ai-inference forwards --model to the - # Copilot CLI only when it differs from its GitHub Models default, so - # omitting it lets the CLI pick its own current default (latest Sonnet) - # and avoids breaking when a pinned slug (e.g. gpt-4.1) is retired. + # Must be an explicit empty string, not omitted. This action defaults + # `model` to "gpt-4.1" and always forwards it as --model, and that slug + # is retired, so omitting the input fails with: + # Error: Model "gpt-4.1" from --model flag is not available. + # An empty string makes the action skip --model entirely and lets the + # Copilot CLI pick its own current default. See actions/ai-inference#271. + model: '' prompt-file: prompt.txt system-prompt-file: system-prompt.txt - max-completion-tokens: 1000 - temperature: 0.3 env: COPILOT_GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_COPILOT }} diff --git a/.github/workflows/check-for-spammy-prs.yml b/.github/workflows/check-for-spammy-prs.yml index 94f411e917dd..20c60d2bd0e9 100644 --- a/.github/workflows/check-for-spammy-prs.yml +++ b/.github/workflows/check-for-spammy-prs.yml @@ -28,14 +28,18 @@ jobs: const repo = 'docs' const pull_number = context.payload.pull_request.number - const { data: files } = await github.rest.pulls.listFiles({ - owner: owner, - repo: repo, - pull_number: pull_number, - }); + const files = await github.paginate(github.rest.pulls.listFiles, { + owner, + repo, + pull_number, + per_page: 100, + }) const onlyDeletes = files.length > 0 && files.every(f => f.status === 'removed') - const isEmptyCommit = !files.length + const onlyDeletesLines = + files.some(file => file.deletions > 0) && + files.every(file => file.additions === 0) + const isEmptyCommit = !files.length const touchesTooMany = files.length > 10 const isBlankLineEdit = files.length > 0 && files.every(file => { const changedLines = (file.patch || '') @@ -47,19 +51,34 @@ jobs: const onlyRenames = files.length > 0 && files.every(f => f.status === 'renamed') // Close the PR and add the invalid label - if (onlyDeletes || isEmptyCommit || touchesTooMany || isBlankLineEdit || onlyRenames) { - await github.rest.issues.update({ - owner: owner, - repo: repo, + if ( + onlyDeletesLines || + onlyDeletes || + isEmptyCommit || + touchesTooMany || + isBlankLineEdit || + onlyRenames + ) { + await github.rest.issues.addLabels({ + owner, + repo, issue_number: pull_number, labels: ['invalid'], - }); + }) // Comment on the PR await github.rest.issues.createComment({ - owner: owner, - repo: repo, + owner, + repo, issue_number: pull_number, - body: `This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our [contribution guidelines](https://docs.github.com/en/contributing), or raise an issue.`, - }); + body: onlyDeletesLines + ? `This pull request only removes existing content. Before submitting a content-removal pull request, please [open an issue](https://github.com/github/docs/issues/new/choose) explaining the proposed removal and wait for approval from the GitHub Docs team. Once the change has been approved, you can open a new pull request and link it to the issue.` + : `This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our [contribution guidelines](https://docs.github.com/en/contributing), or raise an issue.`, + }) + + if (onlyDeletesLines) { + core.setFailed( + 'This pull request only deletes lines. An approved issue is required first.', + ) + } } diff --git a/.github/workflows/sync-graphql.yml b/.github/workflows/sync-graphql.yml index 57c77018ade1..e94136afd1fb 100644 --- a/.github/workflows/sync-graphql.yml +++ b/.github/workflows/sync-graphql.yml @@ -95,7 +95,7 @@ jobs: with: slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} message: | - ⚠️ GraphQL Sync found ${{ needs.update_graphql_files.outputs.ignored-count }} ignored change types: ${{ needs.update_graphql_files.outputs.ignored-types }} + :graphql: GraphQL Sync found ${{ needs.update_graphql_files.outputs.ignored-count }} ignored change types: ${{ needs.update_graphql_files.outputs.ignored-types }} These change types are not in CHANGES_TO_REPORT and were silently ignored. Consider reviewing if they should be added to the changelog. diff --git a/content/copilot/get-started/enterprise-ai-governance.md b/content/copilot/get-started/enterprise-ai-governance.md index 831c60673078..0436c2cde676 100644 --- a/content/copilot/get-started/enterprise-ai-governance.md +++ b/content/copilot/get-started/enterprise-ai-governance.md @@ -25,6 +25,7 @@ journeyTracks: - href: '/copilot/concepts/enterprise/policies' - href: '/copilot/tutorials/roll-out-at-scale/govern-at-scale/maintain-codebase-standards' - href: '/copilot/how-tos/administer-copilot/manage-for-enterprise/review-audit-logs' + - href: '/copilot/how-tos/administer-copilot/manage-for-enterprise/use-managed-settings/get-started' - id: 'adopting_agents' title: 'Preparing for agents' description: 'Learn what agents can do for your enterprise, and prepare to roll them out.' diff --git a/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/customize-the-agent-environment.md b/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/customize-the-agent-environment.md index 8ee0ce1cf4e6..d21e2c4a470a 100644 --- a/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/customize-the-agent-environment.md +++ b/content/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/customize-the-agent-environment.md @@ -49,7 +49,7 @@ A `copilot-setup-steps.yml` file looks like a normal {% data variables.product.p > [!NOTE] > The `copilot-setup-steps.yml` workflow won't trigger unless it's present on your default branch. -Here is a simple example of a `copilot-setup-steps.yml` file for a TypeScript project that clones the project, installs Node.js and downloads and caches the project's dependencies. You should customize this to fit your own project's language(s) and dependencies: +Here is a simple example of a `copilot-setup-steps.yml` file for a TypeScript project that clones the project, installs Node.js and downloads and caches the project's dependencies. You should customize this to fit your own project, including its language(s), its dependencies, and the workflow triggers you need. For example, you wouldn't typically run on both `push` and `pull_request`. ```yaml copy name: "Copilot Setup Steps" diff --git a/content/rest/code-scanning/ai-scan.md b/content/rest/code-scanning/ai-scan.md new file mode 100644 index 000000000000..09b5ca9732ba --- /dev/null +++ b/content/rest/code-scanning/ai-scan.md @@ -0,0 +1,14 @@ +--- +title: REST API endpoints for AI Scan +shortTitle: AI Scan +intro: Use the REST API to get and update AI Scan settings for an organization. +versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 + fpt: '*' + ghec: '*' +autogenerated: rest +category: + - Secure code and manage vulnerabilities +allowTitleToDifferFromFilename: true +--- + + diff --git a/content/rest/code-scanning/index.md b/content/rest/code-scanning/index.md index e80ddeefbd22..f8c98f4522af 100644 --- a/content/rest/code-scanning/index.md +++ b/content/rest/code-scanning/index.md @@ -10,6 +10,7 @@ versions: ghec: '*' ghes: '*' children: + - /ai-scan - /alert-dismissal-requests - /code-scanning autogenerated: rest diff --git a/src/cli-docs-auto-maintenance/state/copilot-cli/automation-and-ci.json b/src/cli-docs-auto-maintenance/state/copilot-cli/automation-and-ci.json deleted file mode 100644 index 06b3c4850c81..000000000000 --- a/src/cli-docs-auto-maintenance/state/copilot-cli/automation-and-ci.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Automation and CI", - "sha": "7b8276b2bcaafc444a3dcf482a033352ebb3faa1", - "articles": [ - "content/copilot/concepts/agents/copilot-cli/copilot-cli-in-github-actions.md", - "content/copilot/how-tos/copilot-cli/automate-copilot-cli/automate-with-actions.md", - "content/copilot/how-tos/copilot-cli/automate-copilot-cli/index.md", - "content/copilot/how-tos/copilot-cli/automate-copilot-cli/quickstart.md", - "content/copilot/how-tos/copilot-cli/automate-copilot-cli/run-cli-programmatically.md", - "content/copilot/how-tos/copilot-cli/automate-copilot-cli/schedule-prompts.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli-in-actions.md" - ] -} diff --git a/src/cli-docs-auto-maintenance/state/copilot-cli/integrations-and-remote-control.json b/src/cli-docs-auto-maintenance/state/copilot-cli/integrations-and-remote-control.json deleted file mode 100644 index 4eceb5f493f7..000000000000 --- a/src/cli-docs-auto-maintenance/state/copilot-cli/integrations-and-remote-control.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "Integrations and remote control", - "sha": "7b8276b2bcaafc444a3dcf482a033352ebb3faa1", - "articles": [ - "content/copilot/concepts/agents/copilot-cli/about-remote-control.md", - "content/copilot/concepts/agents/copilot-cli/chronicle.md", - "content/copilot/concepts/agents/copilot-cli/lsp-servers.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/add-lsp-servers.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/browse-issues-prs-gists.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/connecting-vs-code.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/delegate-tasks-to-cca.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/manage-pull-requests.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/steer-remotely.md", - "content/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input.md" - ], - "proposed": [ - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/browse-issues-prs-gists.md", - "text": "* Press / (on the **Issues** and **Pull requests** tabs) to filter the list with your own search terms. Type your terms, press Enter to run the search, and Esc to cancel or clear it." - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/browse-issues-prs-gists.md", - "text": "To run your own search, press /. An inline search box opens where you can type your search terms, then press Enter to run the search." - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/browse-issues-prs-gists.md", - "text": "Your search terms are added to the qualifiers the tab already applies, so results are always limited to open items in the current repository—and, unless you have pressed a, to items that involve you. Enter plain search terms rath" - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/manage-pull-requests.md", - "text": " /pr automerge Do the same as /pr auto, then merge the pull request once it is green. Find out more No Enter with \"Download default model\" selected to download the default multilingual speech-to-text model." - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input.md", - "text": "Alternatively, if you want to use the dedicated English or Spanish model:" - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input.md", - "text": "1. In the voice models picker, use the arrow keys to select the model you want, then press Enter to download it." - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input.md", - "text": "The default multilingual model handles more than one language, but you can switch to the dedicated English or Spanish model if you prefer. The model you want must be downloaded and activated before you can use it." - }, - { - "article": "content/copilot/how-tos/copilot-cli/use-copilot-cli/voice-input.md", - "text": "1. In the voice models picker, use the arrow keys on your keyboard to select the model you want to use, then press Enter." - } - ], - "rejected": [] -} diff --git a/src/cli-docs-auto-maintenance/state/copilot-cli/setup-and-installation.json b/src/cli-docs-auto-maintenance/state/copilot-cli/setup-and-installation.json deleted file mode 100644 index 1301d70d57bd..000000000000 --- a/src/cli-docs-auto-maintenance/state/copilot-cli/setup-and-installation.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "Setup and installation", - "sha": "8f269b4e7f4cd58744a6edf8093e55820f6d765c", - "articles": [ - "content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md", - "content/copilot/concepts/agents/copilot-cli/index.md", - "content/copilot/how-tos/copilot-cli/cli-getting-started.md", - "content/copilot/how-tos/copilot-cli/index.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/index.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli.md", - "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md" - ], - "proposed": [ - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "* **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 " - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "| OAuth token (browser or device flow) | `gho_` | Yes | Default method via `copilot login` |" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "> * 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 " - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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 known remote or headless environment." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "How do you want to sign in? 1. Sign in with your browser (recommended) 2. Sign in with a device code" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "* **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." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "* **Device code**: The CLI displays a one-time user code, and can copy it to your clipboard and open your browser for you." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "```text Waiting for authorization... Enter one-time code: 1234-5678 at https://github.com/login/device Press any key to copy to clipboard and open browser... ```" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "```text Opening your browser to authenticate... If it doesn't open automatically, visit: URL Waiting for authorization... ```" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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 copies it to your clipboard and o" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "To authenticate, visit https://github.com/login/device and enter code 1234-5678 Waiting for authorization..." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "To force a particular flow, add the `--web-flow` or `--device-code` option." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md", - "text": "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." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md", - "text": "export COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN" - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md", - "text": "A token starting with `ghp_` is rejected. If it is the only credential available, {% data variables.copilot.copilot_cli_short %} refuses to start and displays the following error, naming the environment variable that holds the token." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md", - "text": " ```text Error: Classic Personal Access Tokens (ghp_) are not supported by Copilot." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md", - "text": "The GITHUB_TOKEN environment variable contains a classic PAT. Please use a Fine-Grained Personal Access Token or another authentication method." - }, - { - "article": "content/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth.md", - "text": "To fix this, you can: • Replace the token in GITHUB_TOKEN with a fine-grained PAT • Unset GITHUB_TOKEN and run 'gh auth login' to authenticate • Unset GITHUB_TOKEN and start 'copilot', then use the '/login' command ```