diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5f9456e02dbb..453bbb578975 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -27,7 +27,7 @@ jobs: days-before-stale: 30 days-before-close: 14 stale-pr-label: 'stale' - exempt-pr-labels: 'never-stale' + exempt-pr-labels: 'never-stale,localization' close-pr-label: 'Closed as inactive' operations-per-run: 150 diff --git a/.github/workflows/triage-stale-check.yml b/.github/workflows/triage-stale-check.yml index b04ce765881d..811fdc27ab94 100644 --- a/.github/workflows/triage-stale-check.yml +++ b/.github/workflows/triage-stale-check.yml @@ -30,7 +30,7 @@ jobs: stale-issue-label: 'Inactive' close-issue-label: 'Closed as inactive' - exempt-pr-labels: 'never-stale,ready to merge,waiting for review,needs SME' + exempt-pr-labels: 'never-stale,localization,ready to merge,waiting for review,needs SME' stale-pr-message: 'A stale label has been added to this pull request because it has been open 30 days with no activity. If you think this pull request should remain open, please add a new comment.' stale-pr-label: 'Inactive' close-pr-label: 'Closed as inactive' diff --git a/content/code-security/concepts/code-scanning/ai-powered-security-detections.md b/content/code-security/concepts/code-scanning/ai-powered-security-detections.md index 17ee868d63e4..7cc0405c8425 100644 --- a/content/code-security/concepts/code-scanning/ai-powered-security-detections.md +++ b/content/code-security/concepts/code-scanning/ai-powered-security-detections.md @@ -106,6 +106,9 @@ Enabling the organization setting enables AI Scan immediately for all eligible r You do not need to select a model to enable AI Scan. +> [!NOTE] +> {% data reusables.code-scanning.ai-scan-model-policies %} + * **Enterprise**: Enterprise owners can allow or prevent organizations from enabling AI Scan. The policy is set to "Not allowed" by default. This policy controls both AI Scan on pull requests and AI Scan for a repository's backlog. Allowing AI Scan does not enable it automatically. See [AUTOTITLE](/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise#enforcing-a-policy-to-manage-ai-scan-in-your-enterprises-repositories). * **Organization**: Organization owners and security managers can enable AI Scan for pull requests for eligible repositories. Repositories inherit the organization setting. See [AUTOTITLE](/code-security/how-tos/secure-at-scale/configure-organization-security/establish-complete-coverage/configure-global-settings#enabling-ai-scan-for-pull-requests). * **Organization-owned repository**: People with admin access to the repository can opt out when the organization has enabled AI Scan. They cannot opt in when the organization setting is disabled. diff --git a/content/code-security/concepts/code-scanning/ai-scan-for-repositories.md b/content/code-security/concepts/code-scanning/ai-scan-for-repositories.md index 6c4459b0f7e4..09db1ae4b98d 100644 --- a/content/code-security/concepts/code-scanning/ai-scan-for-repositories.md +++ b/content/code-security/concepts/code-scanning/ai-scan-for-repositories.md @@ -71,6 +71,9 @@ AI Scan for repositories supports all languages, including languages already sup ## Enabling AI Scan for repositories +> [!NOTE] +> {% data reusables.code-scanning.ai-scan-model-policies %} + Before enabling AI Scan for repositories, confirm repository eligibility, review the billing account's included {% data variables.product.prodname_ai_credits_short %}, and configure budgets for metered usage. * **Enterprise**: Enterprise owners can allow or prevent organizations from enabling AI Scan for repositories. This policy controls both AI Scan on pull requests and AI Scan for a repository's backlog. The policy is set to "Not allowed" by default. Allowing AI Scan does not enable it automatically. See [AUTOTITLE](/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise#enforcing-a-policy-to-manage-ai-scan-in-your-enterprises-repositories). diff --git a/content/integrations/how-tos/using-github-event-streams.md b/content/integrations/how-tos/using-github-event-streams.md index 225a6c4d5962..2a068bd9a729 100644 --- a/content/integrations/how-tos/using-github-event-streams.md +++ b/content/integrations/how-tos/using-github-event-streams.md @@ -37,7 +37,7 @@ Event Streams is only available on {% data variables.product.prodname_dotcom_the ## Quickstart -These examples use the [{% data variables.product.prodname_cli %}](https://cli.github.com/) (`gh`) for the API calls and `curl` for the stream. +These examples use the [{% data variables.product.prodname_cli %}](https://cli.github.com/) (`gh`) for the API calls and `curl` for the stream, so you can see each step of the API. If you use {% data variables.product.prodname_cli %} 2.105.0 or later, the `gh event` commands handle subscribing, streaming, and reconnecting for you. See [Using {% data variables.product.prodname_cli %} commands](#using-github-cli-commands). ### 1. Create a subscription @@ -77,6 +77,32 @@ When you've finished, close the stream. Deleting a subscription doesn't close it gh api -X DELETE /event-subscriptions/ID ``` +## Using {% data variables.product.prodname_cli %} commands + +{% data variables.product.prodname_cli %} 2.105.0 and later include `gh event` commands for Event Streams. These commands are also in {% data variables.release-phases.public_preview %} and subject to change. + +To wait for an event on a pull request, run `gh event listen` with the pull request's URL and one or more event types: + +```shell +gh event listen --resource https://github.com/OWNER/REPO/pull/NUMBER \ + --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1 +``` + +`gh event listen` creates a subscription, or reuses your existing one for the same pull request and event types. It then opens the stream and prints each event as one line of JSON. It reconnects when the stream drops, and creates the subscription again if it expires. + +* By default, the command exits after the first event. This suits agents, which usually wait for a command to finish before they continue. +* `--count N` exits after N events, and `--follow` keeps listening until you stop it. +* `--timeout` stops waiting after a duration such as `30m`, and exits with status `8`. +* `--jq` and `--template` format each event, as with `gh api`. For example, `--jq .data.conclusion` prints only a check suite's conclusion. + +The command prints `Listening for events.` to stderr once the stream is open. Changes made before then aren't reported, so read the pull request's current state after you see this line. + +To manage subscriptions directly, use `gh event subscription list`, `create`, `view`, and `delete`. `gh event listen` doesn't delete its subscription when it exits. Subscriptions expire after 24 hours. + +When `gh` detects that an agent is calling it, commands such as `gh pr create`, `gh pr view`, `gh run view`, `gh run watch`, and `gh api` suggest `gh event listen` instead of polling. + +For all options, run `gh event listen --help`. + ## API reference All routes are on `https://api.github.com`. @@ -173,6 +199,7 @@ Error responses include `message`, `documentation_url`, and `status`. * **No "all checks completed" event:** you get one event per check suite. To know whether all checks are done, fetch the pull request's check suites after each event. * **Pull request conversation comments:** comments on the pull request's conversation tab don't produce events yet. Review comments do, as review events. * **Open streams after deletion:** deleting a subscription doesn't close its open streams yet. Close the stream yourself before you delete the subscription. +* **Commit statuses:** check suite events don't cover commit statuses created with the REST API. If a pull request's required checks include commit statuses, fetch them separately. * **No replay:** see [Handling the stream](#handling-the-stream). ## Giving feedback diff --git a/data/reusables/code-scanning/ai-scan-model-policies.md b/data/reusables/code-scanning/ai-scan-model-policies.md new file mode 100644 index 000000000000..417e92de6e68 --- /dev/null +++ b/data/reusables/code-scanning/ai-scan-model-policies.md @@ -0,0 +1 @@ +AI Scan features do not respect the models enabled in the {% data variables.product.prodname_copilot_short %} **Configure models** policy for your enterprise or organization, so AI Scan may use models that the policy doesn't allow. To control whether AI Scan can run, use the AI Scan settings and enterprise policy instead.