diff --git a/.github/workflows/check-broken-links-github-github.yml b/.github/workflows/check-broken-links-github-github.yml index 0e75724c0ec1..04be7a9b5a57 100644 --- a/.github/workflows/check-broken-links-github-github.yml +++ b/.github/workflows/check-broken-links-github-github.yml @@ -45,7 +45,7 @@ jobs: ENABLED_LANGUAGES: en run: | - node src/frame/server.js & + npm run start & sleep 5 curl --retry-connrefused --retry 3 -I http://localhost:4000/ diff --git a/.github/workflows/validate-github-github-docs-urls.yml b/.github/workflows/validate-github-github-docs-urls.yml index 7092d8565c51..8e1e651aaefb 100644 --- a/.github/workflows/validate-github-github-docs-urls.yml +++ b/.github/workflows/validate-github-github-docs-urls.yml @@ -34,6 +34,12 @@ jobs: steps: - name: Check out repo's default branch uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Picking this number is a "best guess". If we make it too large, + # the checkout will take potentially unnecessariily long. + # This reduces the chance that tj-actions/changed-files has to + # fetch deeper history. But if it needs to, it will. + fetch-depth: 10 - uses: ./.github/actions/node-npm-setup @@ -100,6 +106,7 @@ jobs: # workaround for the time being. # First, gather the URLs that were relevant - name: Get changed content/data files + if: ${{ github.event_name == 'pull_request' }} id: changed-files uses: tj-actions/changed-files@77af4bed286740ef1a6387dc4e4e4dec39f96054 # v43.0.0 with: @@ -109,6 +116,7 @@ jobs: safe_output: false files: | content/** + - name: Generate PR comment if: ${{ github.event_name == 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }} env: diff --git a/Dockerfile b/Dockerfile index 6fe0a898904c..4a46b43351d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,7 +96,7 @@ COPY --chown=node:node next.config.js ./ EXPOSE $PORT -CMD ["node", "src/frame/server.js"] +CMD ["node_modules/.bin/tsx", "src/frame/server.ts"] # -------------------------------------------------------------------------------- # PRODUCTION IMAGE - includes all translations diff --git a/LICENSE-CODE b/LICENSE-CODE index be1b5b2a9995..fce94e6f0dd5 100644 --- a/LICENSE-CODE +++ b/LICENSE-CODE @@ -1,6 +1,6 @@ MIT License -Copyright 2023 GitHub +Copyright 2024 GitHub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/content/actions/learn-github-actions/usage-limits-billing-and-administration.md b/content/actions/learn-github-actions/usage-limits-billing-and-administration.md index 6937bf41c7ca..5904574a04d2 100644 --- a/content/actions/learn-github-actions/usage-limits-billing-and-administration.md +++ b/content/actions/learn-github-actions/usage-limits-billing-and-administration.md @@ -84,6 +84,18 @@ Usage limits apply to self-hosted runners. For more information, see "[AUTOTITLE In addition to the usage limits, you must ensure that you use {% data variables.product.prodname_actions %} within the [GitHub Terms of Service](/free-pro-team@latest/site-policy/github-terms/github-terms-of-service). For more information on {% data variables.product.prodname_actions %}-specific terms, see the [GitHub Additional Product Terms](/free-pro-team@latest/site-policy/github-terms/github-terms-for-additional-products-and-features#a-actions-usage). {% endif %} +{% ifversion fpt or ghec %} + +## {% data variables.product.prodname_actions %} usage metrics + +{% data reusables.actions.actions-usage-metrics-beta-note %} + +If you are on a {% data variables.product.prodname_ghe_cloud %} plan, organization owners and users with the "View organization Actions usage metrics" permission can view {% data variables.product.prodname_actions %} usage metrics for their organization. These metrics can help understand how and where your Actions minutes are being used. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions)." + +When you view usage metrics, it is important to remember that {% data reusables.actions.actions-usage-metrics-not-billing-metrics %} + +{% endif %} + ## Billing for reusable workflows If you reuse a workflow, billing is always associated with the caller workflow. Assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. The caller cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. diff --git a/content/actions/monitoring-and-troubleshooting-workflows/index.md b/content/actions/monitoring-and-troubleshooting-workflows/index.md index 03f4f920b36a..e07f28c40c33 100644 --- a/content/actions/monitoring-and-troubleshooting-workflows/index.md +++ b/content/actions/monitoring-and-troubleshooting-workflows/index.md @@ -18,5 +18,6 @@ children: - /using-workflow-run-logs - /enabling-debug-logging - /notifications-for-workflow-runs + - /viewing-github-actions-usage-metrics-for-your-organization --- {% data reusables.actions.enterprise-github-hosted-runners %} diff --git a/content/actions/monitoring-and-troubleshooting-workflows/viewing-github-actions-usage-metrics-for-your-organization.md b/content/actions/monitoring-and-troubleshooting-workflows/viewing-github-actions-usage-metrics-for-your-organization.md new file mode 100644 index 000000000000..790a0fe49570 --- /dev/null +++ b/content/actions/monitoring-and-troubleshooting-workflows/viewing-github-actions-usage-metrics-for-your-organization.md @@ -0,0 +1,16 @@ +--- +title: Viewing GitHub Actions usage metrics for your organization +shortTitle: GitHub Actions usage metrics +intro: 'Organization owners and CI/CD administrators can view usage metrics for how and where their organization uses {% data variables.product.prodname_actions %}.' +permissions: 'Organization owners and users with the "View organization Actions usage metrics" permissions.' +product: 'Your organization must be on a {% data variables.product.prodname_ghe_cloud %} plan.' +versions: + fpt: '*' + ghec: '*' +--- + +{% data reusables.actions.actions-usage-metrics-beta-note %} + +If you are on a {% data variables.product.prodname_ghe_cloud %} plan, {% data reusables.actions.about-actions-usage-metrics %} + +For more information about how to use {% data variables.product.prodname_actions %} usage metrics, see "[AUTOTITLE](/enterprise-cloud@latest/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions)" in the {% data variables.product.prodname_ghe_cloud %} documentation. diff --git a/content/admin/identity-and-access-management/configuring-authentication-for-enterprise-managed-users/about-support-for-your-idps-conditional-access-policy.md b/content/admin/identity-and-access-management/configuring-authentication-for-enterprise-managed-users/about-support-for-your-idps-conditional-access-policy.md index 9fcbaf6235c8..6e403bed726e 100644 --- a/content/admin/identity-and-access-management/configuring-authentication-for-enterprise-managed-users/about-support-for-your-idps-conditional-access-policy.md +++ b/content/admin/identity-and-access-management/configuring-authentication-for-enterprise-managed-users/about-support-for-your-idps-conditional-access-policy.md @@ -44,6 +44,10 @@ If you're unable to use a service account, another option for unblocking actions {% data variables.product.prodname_github_codespaces %} may not be available if your enterprise uses OIDC SSO with CAP to restrict access by IP addresses. This is because codespaces are created with dynamic IP addresses which it's likely your IdP’s CAP will block. Other CAP policies may also affect {% data variables.product.prodname_github_codespaces %}'s availability, depending on the policy's specific setup. +### The {% data variables.codespaces.serverless %} editor + +The {% data variables.codespaces.serverless %} editor may not be available if your enterprise uses OIDC SSO with CAP to restrict access by IP addresses. This is because {% data variables.codespaces.serverless %} relies on dynamic IP addresses which it's likely your IdP’s CAP will block. Other CAP policies may also affect {% data variables.codespaces.serverless %}'s availability, depending on the policy's specific setup. + ### {% data variables.product.prodname_github_apps %} and {% data variables.product.prodname_oauth_apps %} When {% data variables.product.prodname_github_apps %} and {% data variables.product.prodname_oauth_apps %} sign a user in and make requests on that user's behalf, {% data variables.product.prodname_dotcom %} will send the IP address of the app's server to your IdP for validation. If the IP address of the app's server is not validated by your IdP's CAP, the request will fail. diff --git a/content/admin/managing-your-enterprise-account/changing-the-url-for-your-enterprise.md b/content/admin/managing-your-enterprise-account/changing-the-url-for-your-enterprise.md index cb4eb097fccb..7c5a1bec48a3 100644 --- a/content/admin/managing-your-enterprise-account/changing-the-url-for-your-enterprise.md +++ b/content/admin/managing-your-enterprise-account/changing-the-url-for-your-enterprise.md @@ -23,24 +23,35 @@ If your company pays for {% data variables.product.prodname_ghe_cloud %} by cred {% endnote %} -## Prerequisites +## Considerations when changing your enterprise slug Before changing the slug for an enterprise, ensure you have considered any parts of your enterprise's configuration, automations, or processes that may depend on the old enterprise slug. To minimize disruption, you should address these points either immediately before or immediately after changing the slug. -Parts of your system that may be affected by changing the slug include, but are not limited to, the following points. +Parts of your system that may be affected by changing the slug include, but are not limited to, the following. -- If you have enabled SAML single sign-on (SSO) at the enterprise level, you will need to reconfigure the settings in your identity provider (IdP) to use the new enterprise slug. When you change your slug, existing IdP sessions are not revoked, but your members won't be able to use SSO to access resources in your enterprise until you update the IdP settings. If you have enabled SAML or SCIM at the organization level, changing the slug will not affect SSO. For more information, see "[AUTOTITLE](/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-saml-single-sign-on-for-your-enterprise)." +### SAML single sign-on (SSO) - Before changing the slug, to ensure you will have access to your enterprise even if SSO is not working, we recommend you download the recovery codes for your enterprise. For more information, see "[AUTOTITLE](/admin/identity-and-access-management/managing-recovery-codes-for-your-enterprise/downloading-your-enterprise-accounts-single-sign-on-recovery-codes)." -- Many {% data variables.product.company_short %} API endpoints for managing an enterprise take the enterprise slug as a parameter. If you use these endpoints in automations, you will need to update the API calls to use the new slug. API calls that use the old slug will stop working immediately. The enterprise ID, which can be used as an alternative to the slug in many cases, is not affected by a slug change. -- If you use OpenID Connect (OIDC) in {% data variables.product.prodname_actions %} workflows, and have configured your cloud provider to only accept tokens from a unique URL that includes your enterprise slug, you will need to update the settings in your cloud provider. To prevent workflows from failing, the most robust option is to configure your provider to accept tokens from both the old and new slug just before you change the slug. For more information, see "[AUTOTITLE](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-issuer-value-for-an-enterprise)." -- If your enterprise is linked to one or more {% data variables.product.prodname_ghe_server %} instances via {% data variables.product.prodname_github_connect %}, after changing the slug, you'll need to reset the connection by disabling and then reenabling {% data variables.product.prodname_github_connect %}. For more information, see "[AUTOTITLE](/enterprise-server@latest/admin/configuration/configuring-github-connect/managing-github-connect)" in the {% data variables.product.prodname_ghe_server %} documentation. +If you have enabled SAML single sign-on (SSO) at the enterprise level, you will need to reconfigure the settings in your identity provider (IdP) to use the new enterprise slug. When you change your slug, existing IdP sessions are not revoked, but your members won't be able to use SSO to access resources in your enterprise until you update the IdP settings. If you have enabled SAML or SCIM at the organization level, changing the slug will not affect SSO. For more information, see "[AUTOTITLE](/admin/identity-and-access-management/using-saml-for-enterprise-iam/configuring-saml-single-sign-on-for-your-enterprise)." + +Before changing the slug, to ensure you will have access to your enterprise even if SSO is not working, we recommend you download the recovery codes for your enterprise. For more information, see "[AUTOTITLE](/admin/identity-and-access-management/managing-recovery-codes-for-your-enterprise/downloading-your-enterprise-accounts-single-sign-on-recovery-codes)." + +### API endpoints + +Many {% data variables.product.company_short %} API endpoints for managing an enterprise take the enterprise slug as a parameter. If you use these endpoints in automations, you will need to update the API calls to use the new slug. API calls that use the old slug will stop working immediately. The enterprise ID, which can be used as an alternative to the slug in many cases, is not affected by a slug change. + +### OpenID Connect with {% data variables.product.prodname_actions %} workflows + +If you use OpenID Connect (OIDC) in {% data variables.product.prodname_actions %} workflows, and have configured your cloud provider to only accept tokens from a unique URL that includes your enterprise slug, you will need to update the settings in your cloud provider. To prevent workflows from failing, the most robust option is to configure your provider to accept tokens from both the old and new slug just before you change the slug. For more information, see "[AUTOTITLE](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-issuer-value-for-an-enterprise)." + +### {% data variables.product.prodname_github_connect %} + +If your enterprise is linked to one or more {% data variables.product.prodname_ghe_server %} instances via {% data variables.product.prodname_github_connect %}, after changing the slug, you'll need to reset the connection by disabling and then reenabling {% data variables.product.prodname_github_connect %}. For more information, see "[AUTOTITLE](/enterprise-server@latest/admin/configuration/configuring-github-connect/managing-github-connect)" in the {% data variables.product.prodname_ghe_server %} documentation. ## Changing the enterprise slug {% note %} -**Note:** Before changing the slug for an enterprise, make sure you have understood the potential consequences. For more information, see "[Prerequisites](#prerequisites)." +**Note:** Before changing the slug for an enterprise, make sure you have understood the potential consequences. For more information, see "[Considerations when changing your enterprise slug](#considerations-when-changing-your-enterprise-slug)." {% endnote %} diff --git a/content/admin/managing-your-enterprise-account/creating-a-readme-for-an-enterprise.md b/content/admin/managing-your-enterprise-account/creating-a-readme-for-an-enterprise.md index 14d31f061643..c6a342afb227 100644 --- a/content/admin/managing-your-enterprise-account/creating-a-readme-for-an-enterprise.md +++ b/content/admin/managing-your-enterprise-account/creating-a-readme-for-an-enterprise.md @@ -24,6 +24,9 @@ You can also create READMEs for organizations in your enterprise, visible either {% data reusables.enterprise-accounts.access-enterprise %} 1. On the "Overview" page, click **Create README**. If a README is already present on the page, click **Edit**. 1. Write the content for your README. You can use Markdown to format the content, such as adding headings, images, and lists. For more information, see "[AUTOTITLE](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." + + >[!NOTE] You can only link to publicly hosted images in your README. You cannot upload an image to your README, or link to an image from a private repository. + 1. Click **Save**. ## Further reading diff --git a/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise.md b/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise.md index 47e062d00f16..2f49a624de48 100644 --- a/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise.md +++ b/content/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise.md @@ -48,7 +48,7 @@ Additionally, you can enforce policies for the use of {% data variables.product. ## Enforcing a policy for visibility of dependency insights -Dependency insights show all packages that repositories within your enterprise's organizations depend on. Dependency insights include aggregated information about security advisories and licenses. For more information, see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)." +Dependency insights show all packages that repositories within your enterprise's organizations depend on. Dependency insights include aggregated information about security advisories and licenses. For more information, see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization)." Across all organizations owned by your enterprise, you can control whether organization members can view dependency insights. You can also allow owners to administer the setting on the organization level. For more information, see "[AUTOTITLE](/organizations/managing-organization-settings/changing-the-visibility-of-your-organizations-dependency-insights)." diff --git a/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation.md b/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation.md index 8a008796ece2..f147073b996f 100644 --- a/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation.md +++ b/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation.md @@ -48,8 +48,8 @@ In the following example, replace `INSTALLATION_ACCESS_TOKEN` with an installati curl --request GET \ --url "{% data variables.product.api_url_pre %}/meta" \ --header "Accept: application/vnd.github+json" \ ---header "Authorization: Bearer INSTALLATION_ACCESS_TOKEN"{% ifversion api-date-versioning %} \ ---header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} +--header "Authorization: Bearer INSTALLATION_ACCESS_TOKEN" \ +--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` ## Using the Octokit.js SDK to authenticate as an app installation @@ -138,10 +138,9 @@ The Octokit.js SDK also passes a pre-authenticated `octokit` instance to webhook repo: payload.repository.name, issue_number: payload.issue.number, body: `This is a bot post in response to this issue being opened.`, - {% ifversion api-date-versioning %} headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, } ) }); diff --git a/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app.md b/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app.md index a08dc7c7173e..4d2150b39724 100644 --- a/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app.md +++ b/content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app.md @@ -25,8 +25,8 @@ If a REST API endpoint requires you to authenticate as an app, the documentation curl --request GET \ --url "{% data variables.product.api_url_pre %}/app/installations" \ --header "Accept: application/vnd.github+json" \ - --header "Authorization: Bearer YOUR_JWT"{% ifversion api-date-versioning %} \ - --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} + --header "Authorization: Bearer YOUR_JWT" \ + --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` ## Using the Octokit.js SDK to authenticate as a {% data variables.product.prodname_github_app %} diff --git a/content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app.md b/content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app.md index 64fd9578a7a5..a73c06f931f8 100644 --- a/content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app.md +++ b/content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app.md @@ -29,8 +29,8 @@ To use a JWT, pass it in the `Authorization` header of an API request. For examp curl --request GET \ --url "{% data variables.product.api_url_pre %}/app" \ --header "Accept: application/vnd.github+json" \ ---header "Authorization: Bearer YOUR_JWT"{% ifversion api-date-versioning %} \ ---header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} +--header "Authorization: Bearer YOUR_JWT" \ +--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` {% data reusables.getting-started.bearer-vs-token %} @@ -165,9 +165,9 @@ payload=$( echo -n "${payload_json}" | b64enc ) # Signature header_payload="${header}"."${payload}" -signature=$( +signature=$( openssl dgst -sha256 -sign <(echo -n "${pem}") \ - <(echo -n "${header_payload}") | b64enc + <(echo -n "${header_payload}") | b64enc ) # Create JWT @@ -191,9 +191,9 @@ $header = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Conve }))).TrimEnd('=').Replace('+', '-').Replace('/', '_'); $payload = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((ConvertTo-Json -InputObject @{ - iat = [System.DateTimeOffset]::UtcNow.AddSeconds(-10).ToUnixTimeSeconds() + iat = [System.DateTimeOffset]::UtcNow.AddSeconds(-10).ToUnixTimeSeconds() exp = [System.DateTimeOffset]::UtcNow.AddMinutes(10).ToUnixTimeSeconds() - iss = $app_id + iss = $app_id }))).TrimEnd('=').Replace('+', '-').Replace('/', '_'); $rsa = [System.Security.Cryptography.RSA]::Create() diff --git a/content/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events.md b/content/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events.md index cc30fc6fb5a5..5217e0cbc1a4 100644 --- a/content/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events.md +++ b/content/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events.md @@ -184,10 +184,10 @@ async function handlePullRequestOpened({octokit, payload}) { owner: payload.repository.owner.login, repo: payload.repository.name, issue_number: payload.pull_request.number, - body: messageForNewPRs,{% ifversion api-date-versioning %} + body: messageForNewPRs, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); } catch (error) { if (error.response) { diff --git a/content/authentication/securing-your-account-with-two-factor-authentication-2fa/about-mandatory-two-factor-authentication.md b/content/authentication/securing-your-account-with-two-factor-authentication-2fa/about-mandatory-two-factor-authentication.md index fed161dcf4cb..63aa3018b679 100644 --- a/content/authentication/securing-your-account-with-two-factor-authentication-2fa/about-mandatory-two-factor-authentication.md +++ b/content/authentication/securing-your-account-with-two-factor-authentication-2fa/about-mandatory-two-factor-authentication.md @@ -31,7 +31,7 @@ Your account is selected for mandatory 2FA if you have taken some action on {% d ### About mandatory 2FA for organizations and enterprises -Mandatory 2FA is required by {% data variables.product.prodname_dotcom %} itself to improve security for both individual developers and the broader software development ecosystem. Your administrator may also require 2FA enablement as a requirement to join their organization or enterprise, but those requirements are separate from this program. +Mandatory 2FA is required by {% data variables.product.prodname_dotcom %} itself to improve security for both individual developers and the broader software development ecosystem. Your administrator may also require 2FA enablement as a requirement to join their organization or enterprise, but those requirements are separate from this program. To find which users have enabled 2FA or are required to do so, see "[AUTOTITLE](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/viewing-people-in-your-enterprise#viewing-whether-members-in-your-enterprise-have-2fa-enabled)" or "[AUTOTITLE](/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/viewing-whether-users-in-your-organization-have-2fa-enabled)." Your account's eligibility for mandatory 2FA **does not** impact the eligibility of other individuals. For example, if you are an organization owner, and your account is eligible for mandatory 2FA, that does not impact the eligibility of other accounts within your organization. diff --git a/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md b/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md index 6260efd06f69..7469c665b384 100644 --- a/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md +++ b/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md @@ -38,13 +38,11 @@ topics: The {% data variables.product.prodname_dependabot_security_updates %} feature is available for repositories where you have enabled the dependency graph and {% data variables.product.prodname_dependabot_alerts %}. You will see a {% data variables.product.prodname_dependabot %} alert for every vulnerable dependency identified in your full dependency graph. However, security updates are triggered only for dependencies that are specified in a manifest or lock file. For more information, see "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph#dependencies-included)." -{% ifversion dependabot-security-updates-unlock-transitive-dependencies %} - {% note %} -**Note**: For npm, {% data variables.product.prodname_dependabot %} will raise a pull request to update an explicitly defined dependency to a secure version, even if it means updating the parent dependency or dependencies{% ifversion dependabot-security-updates-npm %}, or even removing a sub-dependency that is no longer needed by the parent{% endif %}. For other ecosystems, {% data variables.product.prodname_dependabot %} is unable to update an indirect or transitive dependency if it would also require an update to the parent dependency. For more information, see "[AUTOTITLE](/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors#dependabot-tries-to-update-dependencies-without-an-alert)." +**Note**: For npm, {% data variables.product.prodname_dependabot %} will raise a pull request to update an explicitly defined dependency to a secure version, even if it means updating the parent dependency or dependencies, or even removing a sub-dependency that is no longer needed by the parent. For other ecosystems, {% data variables.product.prodname_dependabot %} is unable to update an indirect or transitive dependency if it would also require an update to the parent dependency. For more information, see "[AUTOTITLE](/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors#dependabot-tries-to-update-dependencies-without-an-alert)." -{% endnote %}{% endif %} +{% endnote %} You can enable a related feature, {% data variables.product.prodname_dependabot_version_updates %}, so that {% data variables.product.prodname_dependabot %} raises pull requests to update the manifest to the latest version of the dependency, whenever it detects an outdated dependency. For more information, see "[AUTOTITLE](/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates)." @@ -66,8 +64,6 @@ When you merge a pull request that contains a security update, the corresponding ## About grouped security updates -{% data reusables.dependabot.dependabot-grouped-security-updates-beta-note %} - To further reduce the number of pull requests you may be seeing, you can enable grouped security updates to group sets of dependencies together (per package ecosystem). {% data variables.product.prodname_dependabot %} then raises a single pull request to update as many vulnerable dependencies as possible in the group to secure versions at the same time. For security updates, {% data variables.product.prodname_dependabot %} will only group dependencies from different directories per ecosystem under certain conditions and configurations. {% data variables.product.prodname_dependabot %} **will not** group dependencies from different package ecosystems together, and it **will not** group security updates with version updates. diff --git a/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md b/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md index a3b22af6c58d..d36325ffeffb 100644 --- a/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md +++ b/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md @@ -62,8 +62,6 @@ You can also enable or disable {% data variables.product.prodname_dependabot_sec ## Grouping {% data variables.product.prodname_dependabot_security_updates %} into a single pull request -{% data reusables.dependabot.dependabot-grouped-security-updates-beta-note %} - To reduce the number of pull requests you may be seeing, you can enable grouped security updates for your repository or organization. When this is enabled, {% data variables.product.prodname_dependabot %} will group security updates into one pull request for each package ecosystem. In order to use grouped security updates, you must first enable the following features: - **Dependency graph**. For more information, see "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph)." diff --git a/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md b/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md index 6f824bb44210..9c410389fdd2 100644 --- a/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md +++ b/content/code-security/dependabot/dependabot-version-updates/customizing-dependency-updates.md @@ -149,10 +149,6 @@ updates: ## Grouping {% data variables.product.prodname_dependabot_updates %} into one pull request -{% ifversion dependabot-grouped-security-updates-config %} -{% data reusables.dependabot.dependabot-grouped-security-updates-beta-note %} -{% endif %} - {% data reusables.dependabot.dependabot-version-updates-groups-about %} {% data reusables.dependabot.dependabot-version-updates-groups-semver %} diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md index 0add753a6058..baf08c01a0f4 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md @@ -65,7 +65,7 @@ For public repositories, only public repositories that depend on it or on packag You can use the dependency graph to: - Explore the repositories your code depends on{% ifversion fpt or ghec %}, and those that depend on it{% endif %}. For more information, see "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository)." {% ifversion ghec %} -- View a summary of the dependencies used in your organization's repositories in a single dashboard. For more information, see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization#viewing-organization-dependency-insights)."{% endif %} +- View a summary of the dependencies used in your organization's repositories in a single dashboard. For more information, see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization#viewing-organization-dependency-insights)."{% endif %} - View and update vulnerable dependencies for your repository. For more information, see "[AUTOTITLE](/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)." - See information about vulnerable dependencies in pull requests. For more information, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request)." diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph.md index 42962434e4b0..d561cef5aa7b 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-the-dependency-graph.md @@ -57,6 +57,6 @@ When the dependency graph is first enabled, any manifest and lock files for supp ## Further reading -{% ifversion ghec %}- "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)"{% endif %} +{% ifversion ghec %}- "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization)"{% endif %} - "[AUTOTITLE](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)" - "[AUTOTITLE](/code-security/dependabot/working-with-dependabot/troubleshooting-the-detection-of-vulnerable-dependencies)" diff --git a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md index 33091f723c8f..b4b322fbd13c 100644 --- a/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md +++ b/content/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository.md @@ -113,6 +113,6 @@ If a manifest or lock file is not processed, its dependencies are omitted from t - "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)" - "[AUTOTITLE](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)"{% ifversion ghec %} -- "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)"{% endif %}{% ifversion fpt or ghec %} +- "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization)"{% endif %}{% ifversion fpt or ghec %} - "[AUTOTITLE](/get-started/privacy-on-github)" {% endif %} diff --git a/content/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide.md b/content/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide.md index f10cc983001b..5d16cc1650f3 100644 --- a/content/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide.md +++ b/content/copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide.md @@ -52,9 +52,9 @@ To use {% data variables.product.prodname_copilot_chat %}, you must first instal 1. In the {% data variables.product.prodname_vscode %} window, click **Reload required** to update {% data variables.product.prodname_vscode %}. 1. If you are prompted to sign in by a toast notification in the bottom right corner of {% data variables.product.prodname_vscode %}, click **Sign in to {% data variables.product.prodname_dotcom %}**. Sign in with the same {% data variables.product.prodname_dotcom %} ID that has a license for {% data variables.product.prodname_copilot %}, or is assigned a seat for {% data variables.product.prodname_copilot %} through an organization. 1. Follow the prompts in {% data variables.product.prodname_vscode %} and on {% data variables.product.prodname_dotcom %} in your browser to complete the sign in and authentication process. -1. To confirm that {% data variables.product.prodname_copilot_chat %} has been successfully installed, in the activity bar on the left side of the {% data variables.product.prodname_vscode %} window, click the **{% data variables.product.prodname_copilot_chat %}** icon to open the {% data variables.product.prodname_copilot_chat %} chat window. +1. To confirm that {% data variables.product.prodname_copilot_chat %} has been successfully installed, in the activity bar on the left side of the {% data variables.product.prodname_vscode %} window, click the **{% data variables.product.prodname_copilot_chat_short %}** icon to open the {% data variables.product.prodname_copilot_chat_short %} chat window. - ![Screenshot of the {% data variables.product.prodname_copilot_chat %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png) + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png) {% note %} @@ -66,24 +66,24 @@ To use {% data variables.product.prodname_copilot_chat %}, you must first instal {% data reusables.copilot.copilot-chat-exclusively-code-questions %} -1. In the {% data variables.product.prodname_vscode %} activity bar, click the **{% data variables.product.prodname_copilot_chat %}** icon to open the {% data variables.product.prodname_copilot_chat %} chat window. +1. In the {% data variables.product.prodname_vscode %} activity bar, click the **{% data variables.product.prodname_copilot_chat_short %}** icon to open the {% data variables.product.prodname_copilot_chat_short %} chat window. - ![Screenshot of the {% data variables.product.prodname_copilot_chat %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png) + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png) -1. At the bottom of the {% data variables.product.prodname_copilot_chat %} window, in the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for topics** text box, type a coding-related question, then press **Enter**. For example, type "How do I write a function that returns the sum of two numbers?". -1. {% data variables.product.prodname_copilot_chat %} will process your question and provide an answer, with code suggestions when appropriate, in the chat window. +1. At the bottom of the {% data variables.product.prodname_copilot_chat_short %} window, in the **Ask {% data variables.product.prodname_copilot_short %} or type / for commands** text box, type a coding-related question, then press **Enter**. For example, type "How do I write a function that returns the sum of two numbers?". +1. {% data variables.product.prodname_copilot_chat_short %} will process your question and provide an answer, with code suggestions when appropriate, in the chat window. If your question is outside the scope of {% data variables.product.prodname_copilot_chat %}, it will tell you and may suggest an alternative question to ask. -1. Optionally, if {% data variables.product.prodname_copilot_chat %} suggests a follow-up question above the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for topics** text box, click the follow-up question to ask it. +1. Optionally, if {% data variables.product.prodname_copilot_chat_short %} suggests a follow-up question above the **Ask {% data variables.product.prodname_copilot_short %} or type / for commands** text box, click the follow-up question to ask it. ## Using code suggestions from {% data variables.product.prodname_copilot_chat %} -When {% data variables.product.prodname_copilot_chat %} provides code suggestions, you have a few options for how to use them. +When {% data variables.product.prodname_copilot_chat_short %} provides code suggestions, you have a few options for how to use them. -1. In the {% data variables.product.prodname_copilot_chat %} window, to show the options for a code suggestion, hover over the suggestion. +1. In the {% data variables.product.prodname_copilot_chat_short %} window, to show the options for a code suggestion, hover over the suggestion. - ![Screenshot of code suggestion options in the {% data variables.product.prodname_copilot_chat %} window.](/assets/images/help/copilot/vsc-code-suggestion-options.png) + ![Screenshot of code suggestion options in the {% data variables.product.prodname_copilot_chat_short %} window.](/assets/images/help/copilot/vsc-code-suggestion-options.png) 1. Choose one of the options for using the code suggestion. - To copy the code suggestion to your clipboard, click the **Copy** icon. @@ -94,19 +94,18 @@ When {% data variables.product.prodname_copilot_chat %} provides code suggestion ## Asking {% data variables.product.prodname_copilot_chat %} questions about your code -{% data variables.product.prodname_copilot_chat %} can provide answers and support with a wide range of coding related topics. +{% data variables.product.prodname_copilot_chat_short %} can provide answers and support with a wide range of coding related topics. -1. In {% data variables.product.prodname_vscode %}, open the file you want {% data variables.product.prodname_copilot_chat %} to help you with. -1. Ask {% data variables.product.prodname_copilot_chat %} a question about the file you have open. For example: - - To generate a description of the file's purpose, ask a question like, "What does this file do?" - - To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code." - - To generate a fix for a bug in the file, type a request like, "Fix this bug." +1. In {% data variables.product.prodname_vscode %}, open the file you want {% data variables.product.prodname_copilot_chat_short %} to help you with. +1. In the activity bar, click the **{% data variables.product.prodname_copilot_chat_short %}** icon to open the {% data variables.product.prodname_copilot_chat_short %} chat window. + +{% data reusables.copilot.chat-asking-questions %} ## Sharing feedback about {% data variables.product.prodname_copilot_chat %} -To share feedback about {% data variables.product.prodname_copilot_chat %}, you can use the **share feedback** button in the {% data variables.product.prodname_copilot_chat %} window. +To share feedback about {% data variables.product.prodname_copilot_chat_short %}, you can use the **share feedback** button in the {% data variables.product.prodname_copilot_chat_short %} window. -1. At the top of the {% data variables.product.prodname_copilot_chat %} window, click the ellipsis (**...**), then click **Send Chat Feedback**. +1. At the top of the {% data variables.product.prodname_copilot_chat_short %} window, click the ellipsis (**...**), then click **Send Chat Feedback**. 1. In your browser, in the **vscode-copilot-release** repository, click **New issue**. 1. Choose one of the options that are displayed: - To open an issue to report a bug, click **Bug report for {% data variables.product.prodname_copilot_chat %}**. @@ -168,8 +167,7 @@ To use {% data variables.product.prodname_copilot_chat %} with {% data variables ## Asking your first question {% data reusables.copilot.copilot-chat-exclusively-code-questions %} - -1. In the {% data variables.product.prodname_vs %} menu bar, to launch {% data variables.product.prodname_copilot_chat %}, click **View**, then click **{% data variables.product.prodname_copilot_chat %}**. +{% data reusables.copilot.chat-open-visualstudio %} 1. At the bottom of the {% data variables.product.prodname_copilot_chat_short %} window, in the **Ask {% data variables.product.prodname_copilot_short %}** text box, type a coding related question, then press **Enter**. For example, type "How do I write a function that returns the sum of two numbers?". {% note %} @@ -179,21 +177,19 @@ To use {% data variables.product.prodname_copilot_chat %} with {% data variables {% endnote %} 1. If {% data variables.product.prodname_copilot_chat_short %} offers a code suggestion that you want to use, click the **Copy** icon to copy the code suggestion to your clipboard. -1. Optionally, if {% data variables.product.prodname_copilot_chat %} suggests a follow-up question under your last answer, click the follow-up question to ask it. +1. Optionally, if {% data variables.product.prodname_copilot_chat_short %} suggests a follow-up question under your last answer, click the follow-up question to ask it. ## Asking {% data variables.product.prodname_copilot_chat %} questions about your code -{% data variables.product.prodname_copilot_chat %} can provide answers and support with a wide range of coding related topics. +{% data variables.product.prodname_copilot_chat_short %} can provide answers and support with a wide range of coding related topics. -1. In {% data variables.product.prodname_vs %}, open the file you want {% data variables.product.prodname_copilot_chat %} to help you with. -1. Ask {% data variables.product.prodname_copilot_chat %} a question about the file you have open. For example: - - To generate a description of the file's purpose, ask a question like, "What does this file do" - - To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code." - - To generate a fix for a bug in the file, type a request like, "Fix this bug." +1. In {% data variables.product.prodname_vs %}, open the file you want {% data variables.product.prodname_copilot_chat_short %} to help you with. +{% data reusables.copilot.chat-open-visualstudio %} +{% data reusables.copilot.chat-asking-questions %} ## Sharing feedback about {% data variables.product.prodname_copilot_chat %} -To share feedback about {% data variables.product.prodname_copilot_chat %}, you can use the **Send feedback** button in {% data variables.product.prodname_vs %}. For more information on providing feedback for {% data variables.product.prodname_vs %}, see the [Visual Studio Feedback](https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022) documentation. +To share feedback about {% data variables.product.prodname_copilot_chat_short %}, you can use the **Send feedback** button in {% data variables.product.prodname_vs %}. For more information on providing feedback for {% data variables.product.prodname_vs %}, see the [Visual Studio Feedback](https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022) documentation. 1. In the top right corner of the {% data variables.product.prodname_vs %} window, click the **Send feedback** button. @@ -273,13 +269,13 @@ If {% data variables.product.prodname_copilot_chat_short %} is enabled or disabl {% data reusables.enterprise-accounts.policies-tab %} {% data reusables.enterprise-accounts.copilot-tab %} 1. To the right of **{% data variables.product.prodname_copilot_chat_short %} in the IDE**, select the dropdown menu, and then choose the appropriate option. - - Click **Allowed** to enable {% data variables.product.prodname_copilot_chat %} for all organizations under your enterprise. - - Click **Blocked** to disable {% data variables.product.prodname_copilot_chat %} for all organizations under your enterprise. + - Click **Allowed** to enable {% data variables.product.prodname_copilot_chat_short %} for all organizations under your enterprise. + - Click **Blocked** to disable {% data variables.product.prodname_copilot_chat_short %} for all organizations under your enterprise. - Click **No policy** to allow each organization under your enterprise to set their own policy. ## Installing or updating the {% data variables.product.prodname_copilot %} plugin in JetBrains -To use {% data variables.product.prodname_copilot_chat %} in a JetBrains IDE, you must install or update the {% data variables.product.prodname_copilot %} plugin. If you have not yet installed the {% data variables.product.prodname_copilot %} plugin, follow the steps in "[Installing the {% data variables.product.prodname_copilot %} plugin in your JetBrains IDE](#installing-the-github-copilot-plugin-in-your-jetbrains-ide)." If you have already installed the {% data variables.product.prodname_copilot %} plugin, follow the steps in "[Updating the {% data variables.product.prodname_copilot %} plugin in JetBrains](#updating-the-github-copilot-plugin-in-jetbrains)." +To use {% data variables.product.prodname_copilot_chat_short %} in a JetBrains IDE, you must install or update the {% data variables.product.prodname_copilot %} plugin. If you have not yet installed the {% data variables.product.prodname_copilot %} plugin, follow the steps in "[Installing the {% data variables.product.prodname_copilot %} plugin in your JetBrains IDE](#installing-the-github-copilot-plugin-in-your-jetbrains-ide)." If you have already installed the {% data variables.product.prodname_copilot %} plugin, follow the steps in "[Updating the {% data variables.product.prodname_copilot %} plugin in JetBrains](#updating-the-github-copilot-plugin-in-jetbrains)." The following procedures will guide you through installing or updating the {% data variables.product.prodname_copilot %} plugin in IntelliJ IDEA. Steps to install the plugin in another supported IDE may differ. @@ -298,38 +294,38 @@ The following procedures will guide you through installing or updating the {% da {% data reusables.copilot.copilot-chat-exclusively-code-questions %} -1. At the right side of the JetBrains IDE window, click the **{% data variables.product.prodname_copilot_chat %}** icon to open the {% data variables.product.prodname_copilot_chat %} window. +1. At the right side of the JetBrains IDE window, click the **{% data variables.product.prodname_copilot_chat_short %}** icon to open the {% data variables.product.prodname_copilot_chat_short %} window. - ![Screenshot of the {% data variables.product.prodname_copilot_chat %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png) + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png) -1. At the bottom of the {% data variables.product.prodname_copilot_chat %} window, in the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for commands** text box, type a coding related question, then press **Enter**. For example, type "How do I write a function that returns the sum of two numbers?". -1. {% data variables.product.prodname_copilot_chat %} will process your question and provide an answer, with code suggestions when appropriate, in the chat window. +1. At the bottom of the {% data variables.product.prodname_copilot_chat_short %} window, in the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for commands** text box, type a coding related question, then press **Enter**. For example, type "How do I write a function that returns the sum of two numbers?". +1. {% data variables.product.prodname_copilot_chat_short %} will process your question and provide an answer, with code suggestions when appropriate, in the chat window. If your question is outside the scope of {% data variables.product.prodname_copilot_chat %}, it will tell you and may suggest an alternative question to ask. -1. Optionally, if {% data variables.product.prodname_copilot_chat %} suggests a follow-up question above the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for commands** text box, click the follow-up question to ask it. +1. Optionally, if {% data variables.product.prodname_copilot_chat_short %} suggests a follow-up question above the **Ask {% data variables.product.prodname_copilot_short %} a question or type `/` for commands** text box, click the follow-up question to ask it. ## Asking {% data variables.product.prodname_copilot_chat %} questions about your code -{% data variables.product.prodname_copilot_chat %} can provide answers and support with a wide range of coding-related topics. +{% data variables.product.prodname_copilot_chat_short %} can provide answers and support with a wide range of coding-related topics. -1. In your JetBrains IDE, open the file you want {% data variables.product.prodname_copilot_chat %} to help you with. -1. Ask {% data variables.product.prodname_copilot_chat %} a question about the file you have open. For example: +1. In your JetBrains IDE, open the file you want {% data variables.product.prodname_copilot_chat_short %} to help you with. +1. Ask {% data variables.product.prodname_copilot_chat_short %} a question about the file you have open. For example: - To generate a description of the file's purpose, ask a question like, "What does this file do?" - To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code." - To generate a fix for a bug in the file, type a request like, "Fix this bug." ## Sharing feedback about {% data variables.product.prodname_copilot_chat %} -To share feedback about {% data variables.product.prodname_copilot_chat %}, you can use the **share feedback** link in JetBrains. +To share feedback about {% data variables.product.prodname_copilot_chat_short %}, you can use the **share feedback** link in JetBrains. -1. At the right side of the JetBrains IDE window, click the **{% data variables.product.prodname_copilot_chat %}** icon to open the {% data variables.product.prodname_copilot_chat %} window. +1. At the right side of the JetBrains IDE window, click the **{% data variables.product.prodname_copilot_chat_short %}** icon to open the {% data variables.product.prodname_copilot_chat_short %} window. - ![Screenshot of the {% data variables.product.prodname_copilot_chat %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png) + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png) -1. At the top of the {% data variables.product.prodname_copilot_chat %} window, click the **share feedback** link. +1. At the top of the {% data variables.product.prodname_copilot_chat_short %} window, click the **share feedback** link. - ![Screenshot of the share feedback link in the {% data variables.product.prodname_copilot_chat %} window.](/assets/images/help/copilot/jetbrains-share-feedback.png) + ![Screenshot of the share feedback link in the {% data variables.product.prodname_copilot_chat_short %} window.](/assets/images/help/copilot/jetbrains-share-feedback.png) ## Further reading diff --git a/content/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom.md b/content/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom.md index f01b3bb0b577..c3c9e6438475 100644 --- a/content/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom.md +++ b/content/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom.md @@ -106,10 +106,11 @@ Depending on the question you ask, and your enterprise and organization settings {% data reusables.copilot.ask-copilot-not-displayed %} - + + {% note %} - **Note**: + **Note:** {% data variables.product.prodname_copilot_short %}'s ability to answer natural language questions like these in a repository context is improved when the repository has been indexed for semantic code search. The indexing status of the repository is displayed when you start a conversation that has a repository context. diff --git a/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md b/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md index 586744be06be..78165762c97e 100644 --- a/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md +++ b/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md @@ -63,6 +63,26 @@ If your organization's parent enterprise has selected **No policy** for "{% data Select **Give {% data variables.product.prodname_copilot_short %} access to Bing** to allow {% data variables.product.prodname_copilot_chat_short %} to use search results from Bing to answer questions where appropriate. +## Configuring {% data variables.product.prodname_copilot_enterprise_short %} features for an organization + +After {% data variables.product.prodname_copilot_enterprise_short %} has been enabled for an organization, an administrator should spend a few minutes setting up their organization to ensure users have a great onboarding experience. + +1. Index your organization's most popular repositories. + + {% data variables.product.prodname_copilot_enterprise_short %} works best when repositories have semantic code indexing enabled. For more information, see [AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/using-github-copilot-chat-in-githubcom#repo-indexing-note). + + {% note %} + + **Note:** + + Initial indexing can take up to 30 minutes for large repositories. Once a repository has been indexed for the first time, updates should be indexed much more quickly (typically within 5 minutes). + + {% endnote %} + +1. Create at least one knowledge base. + + Knowledge bases bring together Markdown documentation across one or more repositories and make them available through {% data variables.product.prodname_copilot_enterprise_short %}. Once created, organization members can specify a knowledge base as the context for {% data variables.product.prodname_copilot_chat_dotcom_short %}. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-chat-in-github/managing-copilot-knowledge-bases)." + ## Further reading - "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-access-for-copilot-business-in-your-organization)" diff --git a/content/organizations/collaborating-with-groups-in-organizations/index.md b/content/organizations/collaborating-with-groups-in-organizations/index.md index 2a3c0890da1e..a19530e6d402 100644 --- a/content/organizations/collaborating-with-groups-in-organizations/index.md +++ b/content/organizations/collaborating-with-groups-in-organizations/index.md @@ -20,7 +20,8 @@ children: - /accessing-your-organizations-settings - /customizing-your-organizations-profile - /about-your-organizations-news-feed - - /viewing-insights-for-your-organization + - /viewing-insights-for-dependencies-in-your-organization + - /viewing-usage-metrics-for-github-actions shortTitle: Collaborate with groups --- diff --git a/content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization.md b/content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization.md similarity index 89% rename from content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization.md rename to content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization.md index b1c9c7feb952..a06a01b3d5a9 100644 --- a/content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization.md +++ b/content/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization.md @@ -1,15 +1,16 @@ --- -title: Viewing insights for your organization -intro: 'Organization insights provide data about your organization dependencies.' +title: Viewing insights for dependencies in your organization +intro: Organization dependency insights provide data about your organization dependencies. redirect_from: - /articles/viewing-insights-for-your-organization - /github/setting-up-and-managing-organizations-and-teams/viewing-insights-for-your-organization + - /organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization versions: ghec: '*' topics: - Organizations - Teams -shortTitle: View organization insights +shortTitle: Dependency insights permissions: Organization members can view organization insights. --- diff --git a/content/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions.md b/content/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions.md new file mode 100644 index 000000000000..abadf0e68efd --- /dev/null +++ b/content/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions.md @@ -0,0 +1,38 @@ +--- +title: Viewing usage metrics for GitHub Actions +shortTitle: GitHub Actions usage metrics +intro: 'GitHub Actions usage metrics provide insights into how and where your organization is using resources for its CI/CD pipelines.' +permissions: 'Organization owners and users with the "View organization Actions usage metrics" permission.' +product: 'Your organization must be on a {% data variables.product.prodname_ghe_cloud %} plan.' +versions: + feature: actions-usage-metrics +--- + +{% data reusables.actions.actions-usage-metrics-beta-note %} + +## About {% data variables.product.prodname_actions %} usage metrics + +{% data reusables.actions.about-actions-usage-metrics %} + +{% data reusables.actions.actions-usage-metrics-not-billing-metrics %} + +## Enabling access to {% data variables.product.prodname_actions %} usage metrics + +Organization owners can create custom organization roles to allow people to view {% data variables.product.prodname_actions %} usage metrics for their organization. To provide users with access, select the "View organization Actions usage metrics" role when creating a custom organization role. For more information, see "[AUTOTITLE](/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)." + +## Viewing {% data variables.product.prodname_actions %} usage metrics + +{% data reusables.profile.access_org %} +{% data reusables.user-settings.access_org %} +{% data reusables.organizations.insights %} +1. In the "Insights" navigation menu, click **Actions Usage Metrics**. +1. Optionally, to select a time period to view usage metrics for, choose an option from the **Period** drop down menu at the top right of the page. +1. Click on the tab that contains the usage metrics you would like to view. For more information, see "[About {% data variables.product.prodname_actions %} usage metrics](#about-github-actions-usage-metrics)." +1. Optionally, to filter the data displayed in a tab, create a filter. + 1. Click on the **{% octicon "filter" aria-hidden="true" %} Filter** button. + 1. Click **{% octicon "plus" aria-hidden="true" %} Add a filter**. + 1. Choose a metric you would like to filter results by. + 1. Depending on the metric you chose, fill out information in the "Qualifier," "Operator," and "Value" columns. + 1. Optionally, click **{% octicon "plus" aria-hidden="true" %} Add a filter** to add another filter. + 1. Click **Apply**. +1. Optionally, to download usage metrics to a CSV file, click {% octicon "download" aria-label="Download report" %}. diff --git a/content/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles.md b/content/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles.md index e748c6d1ccaa..c37bdb516379 100644 --- a/content/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles.md +++ b/content/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles.md @@ -48,5 +48,8 @@ Manage organization Actions policies | Access to manage all settings on the "Act Manage organization runners and runner groups | Access to create and manage GitHub-hosted runners, self-hosted runners, and runner groups, and control where self-hosted runners can be created. | "[AUTOTITLE](/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#overview-of-github-hosted-runners)"

"[AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners)" Manage organization Actions secrets | Access to create and manage Actions organization secrets. | "[AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-an-organization)" Manage organization Actions variables | Access to create and manage Actions organization variables. | "[AUTOTITLE](/actions/learn-github-actions/variables#creating-configuration-variables-for-an-organization)" +{%- ifversion actions-usage-metrics %} +View organization Actions usage metrics | View {% data variables.product.prodname_actions %} usage metrics for your organization. | "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions)" +{%- endif %} {% endrowheaders %} diff --git a/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md b/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md index 880b9931045c..e8fc0fdda59c 100644 --- a/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md +++ b/content/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization.md @@ -115,7 +115,7 @@ Some of the features listed below are limited to organizations using {% data var | See all organization members and teams | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | | @mention any visible team | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | | Can be made a _team maintainer_ | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} |{% ifversion ghec %} -| View organization insights (see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization)") | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} |{% endif %}{% ifversion team-discussions %} +| View organization insights (see "[AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization)") | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} |{% endif %}{% ifversion team-discussions %} | View and post public team discussions to **all teams** (see "[AUTOTITLE](/organizations/collaborating-with-your-team/about-team-discussions)") | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | | View and post private team discussions to **all teams** (see "[AUTOTITLE](/organizations/collaborating-with-your-team/about-team-discussions)") | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} |{% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | | Edit and delete team discussions in **all teams** (see "[AUTOTITLE](/communities/moderating-comments-and-conversations/managing-disruptive-comments)") | {% octicon "check" aria-label="Yes" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md index 6421420d945c..74c0d4bdf929 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md @@ -27,6 +27,7 @@ For more information on merging a pull request using a merge queue, see "[AUTOTI - A merge queue cannot be enabled with branch protection rules that use wildcard characters (`*`) in the branch name pattern. - A merge queue will wait for required checks to be reported before it can proceed with merging. You must update your CI configuration to trigger and report on merge group events when requiring a merge queue. +- Merge queue and pull requests checks are coupled and configured under branch protection rules or rulesets. For more information, see "[AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#managing-a-merge-queue)." {% endnote %} diff --git a/content/rest/about-the-rest-api/about-the-openapi-description-for-the-rest-api.md b/content/rest/about-the-rest-api/about-the-openapi-description-for-the-rest-api.md index a3d04d7015b3..ca9fd13d023d 100644 --- a/content/rest/about-the-rest-api/about-the-openapi-description-for-the-rest-api.md +++ b/content/rest/about-the-rest-api/about-the-openapi-description-for-the-rest-api.md @@ -25,7 +25,7 @@ OpenAPI is a specification for describing REST API interfaces. It describes the For each description, there is a version for each product: {% data variables.product.prodname_free_user %}/{% data variables.product.prodname_pro %}/{% data variables.product.prodname_team %} (`api.github.com`), {% data variables.product.prodname_ghe_cloud %} (`ghec`), and each version of {% data variables.product.prodname_ghe_server %} (`ghes-X.X`). -For each product, if date-based versioning is supported, there is also a description for each date-based version. For more information, see {% ifversion api-date-versioning%}"[AUTOTITLE](/rest/overview/api-versions)."{% else %}"[AUTOTITLE](/free-pro-team@latest/rest/overview/api-versions)" in the {% data variables.product.prodname_free_user %} documentation.{% endif %} +For each product, if date-based versioning is supported, there is also a description for each date-based version. For more information, see "[AUTOTITLE](/rest/overview/api-versions)." Each description is available in a bundled or in a dereferenced format. The bundled format uses `$ref` to refer to OpenAPI components that are shared between endpoints. The dereferenced format includes the fully expanded description. diff --git a/content/rest/about-the-rest-api/api-versions.md b/content/rest/about-the-rest-api/api-versions.md index e8d5739d9a20..8a183f241359 100644 --- a/content/rest/about-the-rest-api/api-versions.md +++ b/content/rest/about-the-rest-api/api-versions.md @@ -3,7 +3,9 @@ title: API Versions shortTitle: API Versions intro: Learn how to specify which REST API version to use whenever you make a request to the REST API. versions: - feature: api-date-versioning + fpt: '*' + ghes: '*' + ghec: '*' redirect_from: - /rest/overview/api-versions --- diff --git a/content/rest/about-the-rest-api/breaking-changes.md b/content/rest/about-the-rest-api/breaking-changes.md index 619c3b9a2249..60f2047e8565 100644 --- a/content/rest/about-the-rest-api/breaking-changes.md +++ b/content/rest/about-the-rest-api/breaking-changes.md @@ -3,7 +3,9 @@ title: Breaking changes shortTitle: Breaking changes intro: Learn about breaking changes that were introduced in each REST API version. versions: - feature: api-date-versioning + fpt: '*' + ghes: '*' + ghec: '*' redirect_from: - /rest/overview/breaking-changes --- diff --git a/content/rest/authentication/authenticating-to-the-rest-api.md b/content/rest/authentication/authenticating-to-the-rest-api.md index b4f1ad52efc9..e915afef23c4 100644 --- a/content/rest/authentication/authenticating-to-the-rest-api.md +++ b/content/rest/authentication/authenticating-to-the-rest-api.md @@ -25,8 +25,8 @@ After creating a token, you can authenticate your request by sending the token i ```shell curl --request GET \ --url "{% data variables.product.api_url_code %}/octocat" \ ---header "Authorization: Bearer YOUR-TOKEN"{% ifversion api-date-versioning %} \ ---header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} +--header "Authorization: Bearer YOUR-TOKEN" \ +--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` {% note %} @@ -78,9 +78,9 @@ For example: ```shell curl --request POST \ --url "{% data variables.product.api_url_code %}/applications/YOUR_CLIENT_ID/token" \ ---user "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"{% ifversion api-date-versioning %} \ +--user "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \ --header "Accept: application/vnd.github+json" \ ---header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" \{% endif %} +--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" \ --data '{ "access_token": "ACCESS_TOKEN_TO_CHECK" }' @@ -159,8 +159,8 @@ For an example of how to authenticate in a {% data variables.product.prodname_ac ```shell curl --request GET \ --url "{% data variables.product.api_url_code %}/user" \ ---user USERNAME:PASSWORD{% ifversion api-date-versioning %} \ ---header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} +--user USERNAME:PASSWORD \ +--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` {% else %} diff --git a/content/rest/dependency-graph/sboms.md b/content/rest/dependency-graph/sboms.md index 7a227dc5b792..987f339ad20d 100644 --- a/content/rest/dependency-graph/sboms.md +++ b/content/rest/dependency-graph/sboms.md @@ -7,7 +7,7 @@ intro: >- versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 fpt: '*' ghec: '*' - ghes: '>=3.9' + ghes: '*' topics: - API autogenerated: rest diff --git a/content/rest/enterprise-admin/manage-ghes.md b/content/rest/enterprise-admin/manage-ghes.md index 804e6a74a48c..d53ab6e992ac 100644 --- a/content/rest/enterprise-admin/manage-ghes.md +++ b/content/rest/enterprise-admin/manage-ghes.md @@ -6,7 +6,7 @@ intro: >- Use the REST API to manage your {% data variables.product.product_name %} instance. versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 - ghes: '>=3.9' + ghes: '*' topics: - API autogenerated: rest diff --git a/content/rest/guides/scripting-with-the-rest-api-and-javascript.md b/content/rest/guides/scripting-with-the-rest-api-and-javascript.md index f17f10b2a815..a9db583278b6 100644 --- a/content/rest/guides/scripting-with-the-rest-api-and-javascript.md +++ b/content/rest/guides/scripting-with-the-rest-api-and-javascript.md @@ -128,14 +128,14 @@ await octokit.request("GET /repos/{owner}/{repo}/issues", { }); ``` -The `request` method automatically passes the `Accept: application/vnd.github+json` header. To pass additional headers or a different `Accept` header, add a `headers` property to the object that is passed as a second argument. The value of the `headers` property is an object with the header names as keys and header values as values. For example, to send a `content-type` header with a value of `text/plain`{% ifversion api-date-versioning %} and a `x-github-api-version` header with a value of `{{ allVersions[currentVersion].latestApiVersion }}`{% endif %}: +The `request` method automatically passes the `Accept: application/vnd.github+json` header. To pass additional headers or a different `Accept` header, add a `headers` property to the object that is passed as a second argument. The value of the `headers` property is an object with the header names as keys and header values as values. For example, to send a `content-type` header with a value of `text/plain` and a `x-github-api-version` header with a value of `{{ allVersions[currentVersion].latestApiVersion }}`: ```javascript copy await octokit.request("POST /markdown/raw", { text: "Hello **world**", headers: { - "content-type": "text/plain",{% ifversion api-date-versioning %} - "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}",{% endif %} + "content-type": "text/plain", + "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", }, }); ``` @@ -164,10 +164,10 @@ For example, the following example gets all of the issues from the `github/docs` const issueData = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "github", repo: "docs", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); ``` @@ -177,10 +177,10 @@ The `paginate` method accepts an optional map function, which you can use to col const issueData = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "github", repo: "docs", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }, (response, done) => response.data.map((issue) => { if (issue.title.includes("test")) { @@ -197,10 +197,10 @@ Instead of fetching all of the results at once, you can use `octokit.paginate.it const iterator = octokit.paginate.iterator("GET /repos/{owner}/{repo}/issues", { owner: "github", repo: "docs", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); let issueData = [] @@ -224,10 +224,10 @@ You can use the `paginate` method with the `rest` endpoint methods as well. Pass const iterator = octokit.paginate.iterator(octokit.rest.issues.listForRepo, { owner: "github", repo: "docs", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); ``` @@ -247,10 +247,10 @@ try { owner: "github", repo: "docs", pull_number: 22809, - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); for await (const {data} of iterator) { @@ -272,10 +272,10 @@ Sometimes, {% data variables.product.company_short %} uses a 4xx status code to try { await octokit.request("GET /user/starred/{owner}/{repo}", { owner: "github", - repo: "docs",{% ifversion api-date-versioning %} + repo: "docs", headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); console.log(`The repository is starred by me`); @@ -326,10 +326,10 @@ The `request` method returns a promise that resolves to an object if the request const response = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}", { owner: "github", repo: "docs", - issue_number: 11901,{% ifversion api-date-versioning %} + issue_number: 11901, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); console.log(`The status of the response is: ${response.status}`) @@ -344,10 +344,10 @@ Similarly, the `paginate` method returns a promise. If the request was successfu const data = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "github", repo: "docs", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); console.log(`${data.length} issues were returned`) @@ -376,10 +376,10 @@ async function getChangedFiles({owner, repo, pullNumber}) { owner: owner, repo: repo, pull_number: pullNumber, - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); for await (const {data} of iterator) { @@ -408,10 +408,10 @@ async function commentIfDataFilesChanged({owner, repo, pullNumber}) { owner: owner, repo: repo, issue_number: pullNumber, - body: `It looks like you changed a data file. These files are auto-generated. \n\nYou must revert any changes to data files before your pull request will be reviewed.`,{% ifversion api-date-versioning %} + body: `It looks like you changed a data file. These files are auto-generated. \n\nYou must revert any changes to data files before your pull request will be reviewed.`, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); return comment.html_url; diff --git a/content/rest/packages/packages.md b/content/rest/packages/packages.md index 22e747d45b57..11d5081b9bc9 100644 --- a/content/rest/packages/packages.md +++ b/content/rest/packages/packages.md @@ -8,7 +8,7 @@ intro: >- versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 fpt: '*' ghec: '*' - ghes: '>=3.9' + ghes: '*' topics: - API redirect_from: diff --git a/content/rest/users/social-accounts.md b/content/rest/users/social-accounts.md index d90ac95daf76..731af308db1b 100644 --- a/content/rest/users/social-accounts.md +++ b/content/rest/users/social-accounts.md @@ -6,7 +6,7 @@ intro: Use the REST API to manage social accounts of authenticated users. versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 fpt: '*' ghec: '*' - ghes: '>=3.9' + ghes: '*' topics: - API autogenerated: rest diff --git a/content/rest/using-the-rest-api/getting-started-with-the-rest-api.md b/content/rest/using-the-rest-api/getting-started-with-the-rest-api.md index c7c2b376aec1..8abf3dee5289 100644 --- a/content/rest/using-the-rest-api/getting-started-with-the-rest-api.md +++ b/content/rest/using-the-rest-api/getting-started-with-the-rest-api.md @@ -65,14 +65,10 @@ Headers provide extra information about the request and the desired response. Fo Most {% data variables.product.prodname_dotcom %} REST API endpoints specify that you should pass an `Accept` header with a value of `application/vnd.github+json`. The value of the `Accept` header is a media type. For more information about media types, see "[Media types](#media-types)." -{% ifversion api-date-versioning %} - #### `X-GitHub-Api-Version` You should use this header to specify a version of the REST API to use for your request. For more information, see "[AUTOTITLE](/rest/overview/api-versions)." -{% endif %} - {% ifversion fpt or ghec %} #### `User-Agent` @@ -243,8 +239,8 @@ In your request, specify the following options and values: - **--method** followed by the HTTP method and the path of the endpoint. For more information, see "[HTTP method](#http-method)" and "[Path](#path)." - **--header**: - - **`Accept`**: Pass the media type in an `Accept` header. To pass multiple media types in an `Accept` header, separate the media types with a comma: `Accept: application/vnd.github+json,application/vnd.github.diff`. For more information, see "[`Accept`](#accept)" and "[Media types](#media-types)."{% ifversion api-date-versioning %} - - **`X-GitHub-Api-Version`**: Pass the API version in a `X-GitHub-Api-Version` header. For more information, see "[`X-GitHub-Api-Version`](#x-github-api-version)."{% endif %} + - **`Accept`**: Pass the media type in an `Accept` header. To pass multiple media types in an `Accept` header, separate the media types with a comma: `Accept: application/vnd.github+json,application/vnd.github.diff`. For more information, see "[`Accept`](#accept)" and "[Media types](#media-types)." + - **`X-GitHub-Api-Version`**: Pass the API version in a `X-GitHub-Api-Version` header. For more information, see "[`X-GitHub-Api-Version`](#x-github-api-version)." - **`-f`** or **`-F`** followed by any body parameters or query parameters in `key=value` format. Use the `-F` option to pass a parameter that is a number, Boolean, or null. Use the `-f` option to pass string parameters. Some endpoints use query parameters that are arrays. To send an array in the query string, use the query parameter once per array item, and append `[]` after the query parameter name. For example, to provide an array of two repository IDs, use `-f repository_ids[]=REPOSITORY_A_ID -f repository_ids[]=REPOSITORY_B_ID`. @@ -321,8 +317,8 @@ Specify the following options and values in your request: To use query parameters, add a `?` to the end of the path, then append your query parameter name and value in the form `parameter_name=value`. Separate multiple query parameters with `&`. If you need to send an array in the query string, use the query parameter once per array item, and append `[]` after the query parameter name. For example, to provide an array of two repository IDs, use `?repository_ids[]=REPOSITORY_A_ID&repository_ids[]=REPOSITORY_B_ID`. For more information, see "[Query parameters](#query-parameters)." For an example, see "[Example request using query parameters](#example-request-using-query-parameters-1)." - **`--header` or `-H`**: - - **`Accept`**: Pass the media type in an `Accept` header. To pass multiple media types in an `Accept` header, separate the media types with a comma, for example: `Accept: application/vnd.github+json,application/vnd.github.diff`. For more information, see "[`Accept`](#accept)" and "[Media types](#media-types)."{% ifversion api-date-versioning %} - - **`X-GitHub-Api-Version`**: Pass the API version in a `X-GitHub-Api-Version` header. For more information, see "[`X-GitHub-Api-Version`](#x-github-api-version)."{% endif %} + - **`Accept`**: Pass the media type in an `Accept` header. To pass multiple media types in an `Accept` header, separate the media types with a comma, for example: `Accept: application/vnd.github+json,application/vnd.github.diff`. For more information, see "[`Accept`](#accept)" and "[Media types](#media-types)." + - **`X-GitHub-Api-Version`**: Pass the API version in a `X-GitHub-Api-Version` header. For more information, see "[`X-GitHub-Api-Version`](#x-github-api-version)." - **`Authorization`**: Pass your authentication token in an `Authorization` header. Note that in most cases you can use `Authorization: Bearer` or `Authorization: token` to pass a token. However, if you are passing a JSON web token (JWT), you must use `Authorization: Bearer`. For more information, see "[Authentication](#authentication)." For an example of a request that uses an `Authorization` header, see "[Example request using body parameters](#example-request-using-body-parameters-1)." - **`--data` or `-d`** followed by any body parameters within a JSON object. If you do not need to specify any body parameters in your request, omit this option. For more information, see "[Body parameters](#body-parameters)." For an example, see "[Example request using body parameters](#example-request-using-body-parameters-1)." @@ -367,8 +363,8 @@ The following example uses the "[Create an issue](/rest/issues/issues#create-an- curl \ --request POST \ --url "{% data variables.product.api_url_code %}/repos/{% ifversion ghes %}REPO-OWNER/REPO-NAME{% else %}octocat/Spoon-Knife{% endif %}/issues" \ ---header "Accept: application/vnd.github+json" \{% ifversion api-date-versioning %} ---header "X-GitHub-Api-Version: 2022-11-28" \{% endif %} +--header "Accept: application/vnd.github+json" \ +--header "X-GitHub-Api-Version: 2022-11-28" \ --header "Authorization: Bearer YOUR-TOKEN" \ --data '{ "title": "Created with the REST API", @@ -443,13 +439,13 @@ Create an access token to authenticate your request. You can save your token and The `request` method automatically passes the `Accept: application/vnd.github+json` header. To pass additional headers or a different `Accept` header, add a `headers` property to the object that is passed as a second argument. The value of the `headers` property is an object with the header names as keys and header values as values. - For example, the following code will send a `content-type` header with a value of `text/plain`{% ifversion api-date-versioning %} and a `X-GitHub-Api-Version` header with a value of `{{ allVersions[currentVersion].latestApiVersion }}`{% endif %}. + For example, the following code will send a `content-type` header with a value of `text/plain` and a `X-GitHub-Api-Version` header with a value of `{{ allVersions[currentVersion].latestApiVersion }}`. ```javascript copy await octokit.request("GET /octocat", { headers: { - "content-type": "text/plain",{% ifversion api-date-versioning %} - "X-GitHub-Api-Version": "{{ allVersions[currentVersion].latestApiVersion }}",{% endif %} + "content-type": "text/plain", + "X-GitHub-Api-Version": "{{ allVersions[currentVersion].latestApiVersion }}", }, }); ``` diff --git a/content/rest/using-the-rest-api/troubleshooting-the-rest-api.md b/content/rest/using-the-rest-api/troubleshooting-the-rest-api.md index 60256c9ab614..5ec56f80c393 100644 --- a/content/rest/using-the-rest-api/troubleshooting-the-rest-api.md +++ b/content/rest/using-the-rest-api/troubleshooting-the-rest-api.md @@ -136,8 +136,6 @@ Code | Description `unprocessable` | The parameters that were provided were invalid. `custom` | Refer to the `message` property to diagnose the error. -{% ifversion api-date-versioning %} - ## Not a supported version You should use the `X-GitHub-Api-Version` header to specify an API version. For example: @@ -150,8 +148,6 @@ If you specify a version that does not exist, you will receive a `400 Bad Reques For more information, see "[AUTOTITLE](/rest/overview/api-versions)." -{% endif %} - ## User agent required Requests without a valid `User-Agent` header will be rejected. You should use your username or the name of your application for the `User-Agent` value. diff --git a/content/rest/using-the-rest-api/using-pagination-in-the-rest-api.md b/content/rest/using-the-rest-api/using-pagination-in-the-rest-api.md index fd4e851c3477..f42c74132595 100644 --- a/content/rest/using-the-rest-api/using-pagination-in-the-rest-api.md +++ b/content/rest/using-the-rest-api/using-pagination-in-the-rest-api.md @@ -102,10 +102,10 @@ const octokit = new Octokit({ {% ifversion ghes %} const data = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "octocat", repo: "Spoon-Knife", - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "X-GitHub-Api-Version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); console.log(data) @@ -133,11 +133,11 @@ async function getPaginatedData(url) { while (pagesRemaining) { const response = await octokit.request(`GET ${url}`, { - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "X-GitHub-Api-Version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, }); const parsedData = parseData(response.data) diff --git a/content/search-github/searching-on-github/searching-issues-and-pull-requests.md b/content/search-github/searching-on-github/searching-issues-and-pull-requests.md index 726de8d9e250..51ff9f04e4f1 100644 --- a/content/search-github/searching-on-github/searching-issues-and-pull-requests.md +++ b/content/search-github/searching-on-github/searching-issues-and-pull-requests.md @@ -22,7 +22,7 @@ You can search for issues and pull requests globally across all of {% data varia - This article contains example searches on the {% data variables.product.prodname_dotcom %}.com website, but you can use the same search filters on {% data variables.location.product_location %}.{% endif %} - For a list of search syntaxes that you can add to any search qualifier to further improve your results, see "[AUTOTITLE](/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)". - Use quotations around multi-word search terms. For example, if you want to search for issues with the label "In progress," you'd search for `label:"in progress"`. Search is not case sensitive. -- Use a minus (hyphen) symbol to exclude results that match a qualifier. For example, to ignore issues created by the "octocat" user, you'd use `-author:octocat` in your search. +- Use a minus (hyphen) symbol to exclude results that match a qualifier. For example, to ignore issues created by the "octocat" user, you'd use `-author:octocat` in your search. Note that this does not work for [missing metadata qualifiers](#search-by-missing-metadata). - {% data reusables.search.search_issues_and_pull_requests_shortcut %} {% endtip %} @@ -115,11 +115,12 @@ The `author` qualifier finds issues and pull requests created by a certain user ## Search by assignee -The `assignee` qualifier finds issues and pull requests that are assigned to a certain user. You cannot search for issues and pull requests that have _any_ assignee, however, you can search for [issues and pull requests that have no assignee](#search-by-missing-metadata). +The `assignee` qualifier finds issues and pull requests that are assigned to a certain user. You can search for issues and pull requests that have _any_ assignee by using the wildcard character `*`, but only within a single repository. You can also search for [issues and pull requests that have no assignee](#search-by-missing-metadata). | Qualifier | Example | ------------- | ------------- | assignee:USERNAME | [**assignee:vmg repo:libgit2/libgit2**](https://github.com/search?utf8=%E2%9C%93&q=assignee%3Avmg+repo%3Alibgit2%2Flibgit2&type=Issues) matches issues and pull requests in libgit2's project libgit2 that are assigned to @vmg. +| assignee:* | [**is:open is:issue assignee:\***](https://github.com/openssl/openssl/issues/assigned/*) matches open issues within a single repository that are assigned to any user. ## Search by mention @@ -359,7 +360,7 @@ You can search for an issue or pull request that has a locked conversation using ## Search by missing metadata -You can narrow your search to issues and pull requests that are missing certain metadata, using the `no` qualifier. That metadata includes: +You can narrow your search to issues and pull requests that are missing certain metadata, using the `no` qualifier. These qualifiers cannot be combined with the minus (hyphen) symbol to exclude items that are missing metadata. That metadata includes: - Labels - Milestones diff --git a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md index 53dc58e2503e..7a29a8a474a0 100644 --- a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md +++ b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md @@ -231,10 +231,10 @@ async function fetchWebhookDeliveriesSince({lastWebhookRedeliveryTime, app}) { const iterator = app.octokit.paginate.iterator( "GET /app/hook/deliveries", { - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, } ); diff --git a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-repository-webhook.md b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-repository-webhook.md index dbf3c207ba6f..75d89665fefd 100644 --- a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-repository-webhook.md +++ b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-repository-webhook.md @@ -237,10 +237,10 @@ async function fetchWebhookDeliveriesSince({ owner: repoOwner, repo: repoName, hook_id: hookId, - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, } ); diff --git a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-an-organization-webhook.md b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-an-organization-webhook.md index bb7b234edae3..b05d958cfd24 100644 --- a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-an-organization-webhook.md +++ b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-an-organization-webhook.md @@ -230,10 +230,10 @@ async function fetchWebhookDeliveriesSince({ { org: organizationName, hook_id: hookId, - per_page: 100,{% ifversion api-date-versioning %} + per_page: 100, headers: { "x-github-api-version": "{{ allVersions[currentVersion].latestApiVersion }}", - },{% endif %} + }, } ); diff --git a/data/features/actions-usage-metrics.yml b/data/features/actions-usage-metrics.yml new file mode 100644 index 000000000000..aa5b977270b7 --- /dev/null +++ b/data/features/actions-usage-metrics.yml @@ -0,0 +1,4 @@ +# Issue 13896 +# Versioning for Actions Usage Metrics +versions: + ghec: '*' diff --git a/data/features/dependabot-grouped-security-updates-config.yml b/data/features/dependabot-grouped-security-updates-config.yml index f009d954c2a2..b0202387117e 100644 --- a/data/features/dependabot-grouped-security-updates-config.yml +++ b/data/features/dependabot-grouped-security-updates-config.yml @@ -1,4 +1,4 @@ -# Reference: Issue #13341 Dependabot Grouped Security Updates: Configure Groups +# Reference: Issue #13341 & 13345 Dependabot Grouped Security Updates: Configure Groups versions: fpt: '*' ghec: '*' diff --git a/data/reusables/actions/about-actions-usage-metrics.md b/data/reusables/actions/about-actions-usage-metrics.md new file mode 100644 index 000000000000..9abc7362a56b --- /dev/null +++ b/data/reusables/actions/about-actions-usage-metrics.md @@ -0,0 +1,7 @@ +{% data variables.product.prodname_actions %} usage metrics enable you to analyze how your organization is using Actions minutes. You can view usage information related to: + +- **Workflows**. View usage data for each workflow in your organization, and use this information to identify opportunities for optimization, such as refactoring a workflow or using a {% data variables.actions.hosted_runner %}. +- **Jobs**. See which jobs are the most resource-intensive and where they are running. +- **Repositories**. Get a high-level snapshot of each repository in your organization and their volume of Actions minutes usage. +- **Runtime OS**. Understand how runners for each operating system are using Actions minutes and what types of operating systems your workflows are running on most often. +- **Runner type**. Compare how your self-hosted runners and GitHub-hosted runners use Actions minutes and the volume of workflow runs for each type of runner. diff --git a/data/reusables/actions/actions-usage-metrics-beta-note.md b/data/reusables/actions/actions-usage-metrics-beta-note.md new file mode 100644 index 000000000000..3df2f9bbec88 --- /dev/null +++ b/data/reusables/actions/actions-usage-metrics-beta-note.md @@ -0,0 +1 @@ +>[!NOTE] {% data variables.product.prodname_actions %} usage metrics are in beta and subject to change. diff --git a/data/reusables/actions/actions-usage-metrics-not-billing-metrics.md b/data/reusables/actions/actions-usage-metrics-not-billing-metrics.md new file mode 100644 index 000000000000..6607b252b664 --- /dev/null +++ b/data/reusables/actions/actions-usage-metrics-not-billing-metrics.md @@ -0,0 +1,3 @@ +{% data variables.product.prodname_actions %} usage metrics do not apply minute multipliers to the metrics displayed. While they _can_ help you understand your bill, their primary purpose is to help you understand how and where Actions minutes are being used in your organization. + +For more information about minute multipliers, see "[AUTOTITLE](/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers)." diff --git a/data/reusables/apps/generate-installation-access-token.md b/data/reusables/apps/generate-installation-access-token.md index f2234df2d20c..d05e73e985f8 100644 --- a/data/reusables/apps/generate-installation-access-token.md +++ b/data/reusables/apps/generate-installation-access-token.md @@ -15,8 +15,8 @@ curl --request POST \ --url "{% data variables.product.api_url_pre %}/app/installations/INSTALLATION_ID/access_tokens" \ --header "Accept: application/vnd.github+json" \ - --header "Authorization: Bearer JWT"{% ifversion api-date-versioning %} \ - --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} + --header "Authorization: Bearer JWT" \ + --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. You can list up to 500 repositories. diff --git a/data/reusables/apps/user-access-token-example-request.md b/data/reusables/apps/user-access-token-example-request.md index e87c7dff1667..82352ae1fd85 100644 --- a/data/reusables/apps/user-access-token-example-request.md +++ b/data/reusables/apps/user-access-token-example-request.md @@ -4,6 +4,6 @@ curl --request GET \ --url "{% data variables.product.api_url_pre %}/user" \ --header "Accept: application/vnd.github+json" \ - --header "Authorization: Bearer USER_ACCESS_TOKEN"{% ifversion api-date-versioning %} \ - --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"{% endif %} + --header "Authorization: Bearer USER_ACCESS_TOKEN" \ + --header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}" ``` diff --git a/data/reusables/code-scanning/beta-swift-support.md b/data/reusables/code-scanning/beta-swift-support.md index a12f20fe28ea..463ad48a4534 100644 --- a/data/reusables/code-scanning/beta-swift-support.md +++ b/data/reusables/code-scanning/beta-swift-support.md @@ -2,8 +2,7 @@ {% note %} **Notes:** -- {% data variables.product.prodname_codeql %} analysis for Swift is currently in beta. During the beta, analysis of Swift code, and the accompanying documentation, will not be as comprehensive as for other languages. Swift 5.8 is not yet supported. -- Analysis may occasionally freeze, causing jobs to time out. To limit the number of Actions minutes used by jobs that are stuck or timing out, we recommend setting a timeout of four times your normal build time. +- {% data variables.product.prodname_codeql %} analysis for Swift is currently in beta. During the beta, analysis of Swift code, and the accompanying documentation, will not be as comprehensive as for other languages. {% endnote %} {% endif %} diff --git a/data/reusables/copilot/chat-asking-questions.md b/data/reusables/copilot/chat-asking-questions.md new file mode 100644 index 000000000000..1f80d6217334 --- /dev/null +++ b/data/reusables/copilot/chat-asking-questions.md @@ -0,0 +1,26 @@ +1. To ask a question about the code that's currently visible in the editor, type `#editor` followed by your question. + + For example, you could type `#editor what does this code do?` to ask {% data variables.product.prodname_copilot_chat_short %} for a description of the code's purpose. + + Use the `#editor` command, anywhere in your question, to tell {% data variables.product.prodname_copilot_chat_short %} to focus on the code that's currently visible in the editor. + +1. If a single method is visible in full in the editor, you could ask {% data variables.product.prodname_copilot_chat_short %} to generate a unit test for the method by typing `Write a unit test for the method in the #editor`. + + Alternatively, select the code you want to generate a unit test for, then ask {% data variables.product.prodname_copilot_short %}: `#selection write a unit test for this code`. + + The `#selection` command ensure that {% data variables.product.prodname_copilot_short %} focuses on the selected code when responding to a question. + +1. To fix a bug in some code, select the code in the editor, then ask {% data variables.product.prodname_copilot_short %}: `#selection fix the bug in this code`. + +1. To focus {% data variables.product.prodname_copilot_short %} on one or more specific files when you ask a question, use the `#file` command. + 1. In the {% data variables.product.prodname_copilot_chat_short %} window, type `#file` and press Enter. This opens the Quick Open palette at the top of the editor. + 1. Select from the list of recently opened files, or search for the file you want to focus on and select it. + 1. Type your question. For example, `#file:app.js What does this file do?`. + + You can use the `#file` command multiple times in your question to focus {% data variables.product.prodname_copilot_short %} on more than one file. + +{% note %} + +**Note:** To find out about other special commands you can use with {% data variables.product.prodname_copilot_chat_short %}, enter `/help` in the chat input box. + +{% endnote %} diff --git a/data/reusables/copilot/chat-open-visualstudio.md b/data/reusables/copilot/chat-open-visualstudio.md new file mode 100644 index 000000000000..3c7c34a21968 --- /dev/null +++ b/data/reusables/copilot/chat-open-visualstudio.md @@ -0,0 +1 @@ +1. In the {% data variables.product.prodname_vs %} menu bar, to launch {% data variables.product.prodname_copilot_chat_short %}, click **View**, then click **{% data variables.product.prodname_copilot_chat %}**. diff --git a/data/reusables/rest-api/version-header.md b/data/reusables/rest-api/version-header.md index d5841c8d31fa..f1ef5513eba4 100644 --- a/data/reusables/rest-api/version-header.md +++ b/data/reusables/rest-api/version-header.md @@ -1 +1 @@ -{% ifversion api-date-versioning %}--header "X-GitHub-Api-Version:{{ allVersions[currentVersion].latestApiVersion }}"{% endif %} +--header "X-GitHub-Api-Version:{{ allVersions[currentVersion].latestApiVersion }}" diff --git a/package-lock.json b/package-lock.json index b65397fdaae1..46fc14748e98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -89,6 +89,7 @@ "strip-html-comments": "^1.0.0", "styled-components": "^5.3.5", "swr": "^2.2.4", + "tsx": "4.7.1", "unified": "^11.0.3", "unist-util-visit": "^5.0.0", "url-template": "^3.0.0", @@ -154,7 +155,6 @@ "sass": "^1.52.3", "start-server-and-test": "^2.0.3", "ts-jest": "29.1.1", - "tsx": "4.7.1", "typescript": "^5.4.2", "unist-util-remove": "^4.0.0", "unist-util-visit-parents": "6.0.1", @@ -881,6 +881,32 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@elastic/elasticsearch": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-8.11.0.tgz", @@ -949,7 +975,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "aix" @@ -965,7 +990,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -981,7 +1005,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -997,7 +1020,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" @@ -1013,7 +1035,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1029,7 +1050,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1045,7 +1065,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -1061,7 +1080,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -1077,7 +1095,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1093,7 +1110,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1109,7 +1125,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1125,7 +1140,6 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1141,7 +1155,6 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1157,7 +1170,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1173,7 +1185,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1189,7 +1200,6 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1205,7 +1215,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1221,7 +1230,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -1237,7 +1245,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -1253,7 +1260,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -1269,7 +1275,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -1285,7 +1290,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -1301,7 +1305,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -3391,6 +3394,38 @@ "version": "0.3.0", "license": "MIT" }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@types/babel__core": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", @@ -3889,6 +3924,17 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "8.11.0", "license": "MIT", @@ -5230,6 +5276,14 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/cross-env": { "version": "7.0.3", "dev": true, @@ -5808,7 +5862,6 @@ "version": "0.19.11", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz", "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -7391,7 +7444,6 @@ "version": "4.7.2", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", - "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -14000,7 +14052,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } @@ -15239,6 +15290,70 @@ } } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -15281,7 +15396,6 @@ "version": "4.7.1", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", - "dev": true, "dependencies": { "esbuild": "~0.19.10", "get-tsconfig": "^4.7.2" @@ -15300,7 +15414,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -15812,6 +15925,14 @@ "node": ">=8" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -16325,6 +16446,17 @@ "node": ">=12" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "dev": true, diff --git a/package.json b/package.json index b7a5f29fca6b..3d611eb798b0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "default": "./src/*" } }, - "exports": "./src/frame/server.js", + "exports": "./src/frame/server.ts", "scripts": { "analyze-text": "node src/search/scripts/analyze-text.js", "archive-version": "node --max-old-space-size=8192 src/ghes-releases/scripts/archive-version.js", @@ -23,10 +23,11 @@ "check-github-github-links": "node src/links/scripts/check-github-github-links.js", "copy-fixture-data": "node src/tests/scripts/copy-fixture-data.js", "count-translation-corruptions": "tsx src/languages/scripts/count-translation-corruptions.ts", - "debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon --inspect src/frame/server.js", + "debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon --inspect src/frame/server.ts", "delete-orphan-translation-files": "tsx src/workflows/delete-orphan-translation-files.ts", "dev": "cross-env npm start", "find-orphaned-assets": "node src/assets/scripts/find-orphaned-assets.js", + "find-orphaned-features": "tsx src/data-directory/scripts/find-orphaned-features/index.ts", "find-past-built-pr": "tsx src/workflows/find-past-built-pr.ts", "fixture-dev": "cross-env ROOT=src/fixtures/fixtures npm start", "fixture-test": "cross-env ROOT=src/fixtures/fixtures npm test -- src/fixtures/tests", @@ -52,15 +53,15 @@ "rendered-content-link-checker-cli": "node src/links/scripts/rendered-content-link-checker-cli.js", "rest-dev": "node src/rest/scripts/update-files.js", "show-action-deps": "echo 'Action Dependencies:' && rg '^[\\s|-]*(uses:.*)$' .github -I -N --no-heading -r '$1$2' | sort | uniq | cut -c 7-", - "start": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon src/frame/server.js", - "start-all-languages": "cross-env NODE_ENV=development nodemon src/frame/server.js", - "start-for-playwright": "cross-env ROOT=src/fixtures/fixtures TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations ENABLED_LANGUAGES=en,ja NODE_ENV=test node src/frame/server.js", + "start": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon src/frame/server.ts", + "start-all-languages": "cross-env NODE_ENV=development tsx src/frame/server.ts", + "start-for-playwright": "cross-env ROOT=src/fixtures/fixtures TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations ENABLED_LANGUAGES=en,ja NODE_ENV=test tsx src/frame/server.ts", "symlink-from-local-repo": "node src/early-access/scripts/symlink-from-local-repo.js", "sync-rest": "node src/rest/scripts/update-files.js", "sync-search": "cross-env NODE_OPTIONS='--max_old_space_size=8192' start-server-and-test sync-search-server 4002 sync-search-indices", "sync-search-ghes-release": "cross-env GHES_RELEASE=1 start-server-and-test sync-search-server 4002 sync-search-indices", "sync-search-indices": "node src/search/scripts/sync-search-indices.js", - "sync-search-server": "cross-env NODE_ENV=production PORT=4002 MINIMAL_RENDER=true CHANGELOG_DISABLED=true node src/frame/server.js", + "sync-search-server": "cross-env NODE_ENV=production PORT=4002 MINIMAL_RENDER=true CHANGELOG_DISABLED=true tsx src/frame/server.ts", "sync-webhooks": "src/rest/scripts/update-files.js -o webhooks", "test": "cross-env NODE_OPTIONS='--max_old_space_size=4096 --experimental-vm-modules' jest --logHeapUsage", "test-local-dev": "node src/workflows/test-local-dev.js", @@ -80,7 +81,8 @@ "{content,data}/**/*.md": "npm run lint-content -- --precommit --paths" }, "nodemonConfig": { - "ext": "js,json,yml,md,html,scss", + "ext": "ts,js,json,yml,md,html,scss", + "exec": "tsx", "ignore": [ "assets", "script", @@ -313,6 +315,7 @@ "strip-html-comments": "^1.0.0", "styled-components": "^5.3.5", "swr": "^2.2.4", + "tsx": "4.7.1", "unified": "^11.0.3", "unist-util-visit": "^5.0.0", "url-template": "^3.0.0", @@ -378,7 +381,6 @@ "sass": "^1.52.3", "start-server-and-test": "^2.0.3", "ts-jest": "29.1.1", - "tsx": "4.7.1", "typescript": "^5.4.2", "unist-util-remove": "^4.0.0", "unist-util-visit-parents": "6.0.1", diff --git a/src/data-directory/scripts/find-orphaned-features/find.ts b/src/data-directory/scripts/find-orphaned-features/find.ts new file mode 100644 index 000000000000..c516fad8f8eb --- /dev/null +++ b/src/data-directory/scripts/find-orphaned-features/find.ts @@ -0,0 +1,300 @@ +/** + * This script will loop over all pages, in all languages, and look at + * the following: + * + * 1. `title` in frontmatter + * 2. `intro` in frontmatter + * 3. `shortTitle` in frontmatter (if present) + * 4. the markdown body itself + * 5. The `versions:` frontmatter key (if the page is in English) + * + * Then it will search out the features mentioned based on `data/features/*.yml` + * It will make a Set of these (e.g. `dependabot-grouped-dependencies` and + * `ghas-enablement-webhook`) and one by one pluck them away. + * + * After the pages, it will loop over the reusables in English, and do the + * same search there. Once it's done the English, it loops over the + * reusables in the translations (if they exist) and does the same search. + * + * Lastly, it will output the remaining features, as relative file paths. + * For example, `data/features/havent-been-used-in-years.yml` so now you + * know that file can be deleted. + * + * NOTE: A lot of translations have corrupted Liquid. So if we can't parse + * the Liquid we fall back to string search. A regex will try to find + * all `{% ifversion ... %}` (and `elsif`) and search for any features + * mentioned inside that as a string. + * + */ + +import fs from 'fs' +import path from 'path' + +import chalk from 'chalk' +import { TokenizationError } from 'liquidjs' + +import warmServer from '@/frame/lib/warm-server.js' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import languages from '@/languages/lib/languages.js' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js' + +type Options = { + sourceDirectory: string + output?: string + verbose?: boolean +} + +type Page = { + permalinks: Permalink[] + relativePath: string + fullPath: string + title: string + shortTitle?: string + intro: string + markdown: string + languageCode: string + versions: Record +} +type Permalink = { + href: string + languageCode: string +} + +export async function find(options: Options) { + const { sourceDirectory } = options + if (process.env.ENABLED_LANGUAGES && process.env.ENABLED_LANGUAGES === 'en') { + console.warn( + chalk.yellow( + `Only English is enabled. Be careful with the output. + To include all translations make sure they're available and that + ENABLED_LANGUAGES is not set or set to 'all'.`.replaceAll(/\s\s+/g, ' '), + ), + ) + } + const site = await warmServer([]) + + const features = new Set(Object.keys(getDeepDataByLanguage('features', 'en'))) + if (options.verbose) { + console.log(`Found ${features.size} features`) + } + + const pageList: Page[] = site.pageList + if (options.verbose) { + console.log(`Searching ${pageList.length.toLocaleString()} pages`) + } + + const t0 = new Date() + searchAndRemove(features, pageList, Boolean(options.verbose)) + const t1 = new Date() + + if (options.verbose) { + const color = features.size === 0 ? chalk.green : chalk.yellow + console.log( + color( + `Searched ${pageList.length.toLocaleString()} pages in ${formatDelta(t0, t1)}. + And found ${features.size} features remaining (i.e. orphans).`.replace(/\s\s+/, ' '), + ), + ) + } + + const remaining = Array.from(features).map((feature) => + path.join(sourceDirectory, `${feature}.yml`), + ) + if (options.output) { + if (options.output.endsWith('.json')) { + fs.writeFileSync(options.output, JSON.stringify(remaining, null, 2)) + } else { + fs.writeFileSync(options.output, remaining.join('\n')) + } + if (!options.verbose) { + return + } + } + console.log(chalk.bold(`Orphans found (${remaining.length}):`)) + for (const feature of remaining) { + console.log(chalk.green(feature)) + } +} + +function formatDelta(t0: Date, t1: Date) { + const ms = t1.getTime() - t0.getTime() + return `${(ms / 1000).toFixed(1)} seconds` +} + +function searchAndRemove(features: Set, pages: Page[], verbose = false) { + for (const page of pages) { + const content = page.markdown + // We actually never bother looking at the `versions:` frontmatter + // key in translations, so it doesn't matter if the translated + // frontmatter might have `versions: some-old-feature`. + if (page.languageCode === 'en') { + for (const [key, value] of Object.entries(page.versions)) { + if (key === 'feature') { + if (features.has(value)) { + features.delete(value) + } + } + } + } + + const combined = ` + ${content} + ${page.title || ''} + ${page.shortTitle || ''} + ${page.intro || ''} + ` + + checkString(combined, features, { page, verbose, languageCode: page.languageCode }) + } + + // Reusables are a bit special, as they are shared between languages. + // There'll always be a slight mismatch between files present on disk + // in English vs. translations. + // The translations never delete files, so there's often excess reusables + // on disk in translations. And the English might be ahead, meaning a file + // has been introduced in English but not yet translated. + // The code below loops over the English reusables, and takes note of the + // their relative paths and content. Then, we re-use the keys of that map + // to know which files, in the translations, to check. And when we read + // them in, we'll need the English equivalent content to be able to + // use the correctTranslatedContentStrings function. + + const englishReusables = new Map() + for (const filePath of getReusableFiles(path.join(languages.en.dir, 'data', 'reusables'))) { + const relativePath = path.relative(languages.en.dir, filePath) + const fileContent = fs.readFileSync(filePath, 'utf-8') + checkString(fileContent, features, { filePath, verbose, languageCode: 'en' }) + englishReusables.set(relativePath, fileContent) + } + for (const language of Object.values(languages)) { + if (language.code === 'en') continue // Already did that in the loop above + + for (const [relativePath, englishFileContent] of Array.from(englishReusables.entries())) { + const filePath = path.join(language.dir, relativePath) + try { + const fileContent = fs.readFileSync(filePath, 'utf-8') + const correctedFileContent = correctTranslatedContentStrings( + fileContent, + englishFileContent, + { + code: language.code, + relativePath, + }, + ) + + checkString(correctedFileContent, features, { + filePath, + verbose, + languageCode: language.code, + }) + } catch (error) { + if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { + // That a reusable does *not* exist in a translation is + // perfectly expected. It means that English reusable was + // most likely added recently and the translation hasn't been + // translated yet. + continue + } + throw error + } + } + } +} + +function getReusableFiles(root: string): string[] { + const here = [] + for (const file of fs.readdirSync(root)) { + const filePath = `${root}/${file}` + if (fs.statSync(filePath).isDirectory()) { + here.push(...getReusableFiles(filePath)) + } else if (file.endsWith('.md') && file !== 'README.md') { + here.push(filePath) + } + } + return here +} + +const IGNORE_ARGS = new Set(['or', 'and', 'not', '<', '>', 'ghes', 'fpt', 'ghec', '!=', '=']) + +function checkString( + string: string, + features: Set, + { + page, + filePath, + languageCode, + verbose = false, + }: { page?: Page; filePath?: string; languageCode?: string; verbose?: boolean } = {}, +) { + try { + for (const token of getLiquidTokens(string)) { + if (token.name === 'ifversion' || token.name === 'elsif') { + for (const arg of token.args.split(/\s+/)) { + if (IGNORE_ARGS.has(arg)) continue + if (isFloat(arg)) continue + + if (features.has(arg)) { + features.delete(arg) + } + } + } + } + } catch (error) { + if (error instanceof TokenizationError) { + // If it happens in English, it's a serious error + if (languageCode === 'en') throw error + + // The translation might, currently, have corrupted liquid + // So treat it as a string + if (verbose) + console.log( + `TokenizationError in ${page ? page.fullPath : filePath}. Treating ${page ? page.fullPath : filePath} as a string and using regex`, + ) + + for (const feature of Array.from(findByRegex(features, string))) { + features.delete(feature) + } + } else { + throw error + } + } +} + +function findByRegex(features: Set, string: string) { + const found = new Set() + for (const match of string.match(/\{%\s*(ifversion|elsif)\s*(.*?)\s*%\}/g) || []) { + for (const feature of Array.from(features)) { + const regex = new RegExp(`\\s${escapeRegex(feature)}(\\s|%)`, 'i') + if (regex.test(match)) { + found.add(feature) + } + } + } + return found +} + +const test = findByRegex( + new Set(['placeholder', 'foo-bar']), + ` + placeholder + + {%ifversion placeholder-foo or fpt%} + {% elsif not-placeholder %} + {% elsif foo-bar%} + {%endif %} + + {% data reusables.enterprise-migration-tool.placeholder-table %} + {% data placeholder %} +`, +) +console.assert(test.has('foo-bar'), test.toString()) +console.assert(!test.has('placeholder'), test.toString()) + +function escapeRegex(string: string) { + return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&') +} + +function isFloat(x: any) { + return !!(parseFloat(x) + 1) +} diff --git a/src/data-directory/scripts/find-orphaned-features/index.ts b/src/data-directory/scripts/find-orphaned-features/index.ts new file mode 100644 index 000000000000..b4ec025170ca --- /dev/null +++ b/src/data-directory/scripts/find-orphaned-features/index.ts @@ -0,0 +1,18 @@ +import { program } from 'commander' +import { find } from './find' + +program + .name('find-orphaned-features') + .description( + "Compare what's in data/features/*.yml with what's mentioned in Markdown and frontmatter", + ) + +program + .command('find') + .description('Figure out what features are not being used') + .option('-s, --source-directory ', 'Source directory', 'data/features') + .option('-o, --output ', 'Output file') + .option('-v, --verbose', 'Verbose') + .action(find) + +program.parse(process.argv) diff --git a/src/fixtures/fixtures/versionless-redirects.txt b/src/fixtures/fixtures/versionless-redirects.txt index 3b3829fc60a6..2822d1153430 100644 --- a/src/fixtures/fixtures/versionless-redirects.txt +++ b/src/fixtures/fixtures/versionless-redirects.txt @@ -453,7 +453,8 @@ - /github/setting-up-and-managing-your-enterprise/managing-use-of-advanced-security-for-organizations-in-your-enterprise-account - /github/setting-up-and-managing-billing-and-payments-on-github/viewing-your-github-advanced-security-usage -/enterprise-cloud@latest/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization +/enterprise-cloud@latest/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization +- /organizations/collaborating-with-groups-in-organizations/viewing-insights-for-dependencies-in-your-organization - /organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization - /articles/viewing-insights-for-your-organization - /github/setting-up-and-managing-organizations-and-teams/viewing-insights-for-your-organization diff --git a/src/frame/server.js b/src/frame/server.ts similarity index 100% rename from src/frame/server.js rename to src/frame/server.ts diff --git a/src/languages/lib/correct-translation-content.js b/src/languages/lib/correct-translation-content.js index 7999255cf1f9..dbf039765462 100644 --- a/src/languages/lib/correct-translation-content.js +++ b/src/languages/lib/correct-translation-content.js @@ -27,7 +27,8 @@ export function correctTranslatedContentStrings(content, englishContent, context content = content.replaceAll('{% данных variables', '{% data variables') content = content.replaceAll('{% данными variables', '{% data variables') content = content.replaceAll('{% данных организации variables', '{% data variables') - content = content.replaceAll('{% данным variables', '{% data variables') + content = content.replaceAll('{% данным variables.', '{% data variables.') + content = content.replaceAll('{% данные variables.', '{% data variables.') content = content.replaceAll('{% данных reusables', '{% data reusables') content = content.replaceAll('{% данными reusables', '{% data reusables') content = content.replaceAll('{% variables.', '{% data variables.') @@ -36,6 +37,14 @@ export function correctTranslatedContentStrings(content, englishContent, context content = content.replaceAll('{% ifversion fpt или ghec %}', '{% ifversion fpt or ghec %}') content = content.replaceAll('{% endif _%}', '{% endif %}') content = content.replaceAll('{% конечным %}', '{% endif %}') + content = content.replaceAll('{% переменных данных.', '{% data variables.') + content = content.replaceAll('{% повторно используемых данных.', '{% data reusables.') + content = content.replaceAll('{% примечание %}', '{% note %}') + content = content.replaceAll('{% конечных головщиков %}', '{% endrowheaders %}') + content = content.replaceAll('{% данных для повторного использования.', '{% data reusables.') + content = content.replaceAll('{% еще %}', '{% else %}') + content = content.replaceAll('{% необработанные %}', '{% raw %}') + content = content.replaceAll('{% подсказки %}', '{% tip %}') // For the rather custom Russian translation of // the content/get-started/learning-about-github/github-glossary.md page diff --git a/src/tests/README-1.md b/src/tests/README-1.md index 30bc8f839879..46db2004338f 100644 --- a/src/tests/README-1.md +++ b/src/tests/README-1.md @@ -84,7 +84,7 @@ since the server won't need to start and stop every time you run tests. In one terminal, type: ```shell -NODE_ENV=test PORT=4000 node src/frame/server.js +NODE_ENV=test PORT=4000 tsx src/frame/server.ts ``` In another terminal, type: diff --git a/tsconfig.json b/tsconfig.json index e75e8ff18ccc..58ad36c7ec2a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "ES2017", "lib": [ "dom", "dom.iterable",