From 3714cfb2f5a0a39461ce3b67e0dc3024e88ed4fe Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Wed, 22 Jan 2025 14:28:42 +0000 Subject: [PATCH 1/2] Hack Week 2025: update `product.product_name` in `/content/search-github` (#54030) Co-authored-by: Kevin Heis Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com> --- .../about-searching-on-github.md | 28 +++++++---------- ...g-repository-search-across-environments.md | 8 ++--- .../index.md | 3 +- .../sorting-search-results.md | 30 +++++++++---------- .../troubleshooting-search-queries.md | 4 +-- .../understanding-the-search-syntax.md | 4 +-- .../finding-files-on-github.md | 2 +- .../searching-on-github/searching-code.md | 2 +- .../searching-on-github/searching-commits.md | 4 +-- .../searching-discussions.md | 6 ++-- .../searching-for-packages.md | 6 ++-- .../searching-for-repositories.md | 2 +- .../searching-on-github/searching-gists.md | 4 +-- .../searching-issues-and-pull-requests.md | 14 ++++----- .../searching-on-github/searching-topics.md | 12 ++++---- .../searching-on-github/searching-users.md | 8 +++-- .../searching-on-github/searching-wikis.md | 4 +-- data/reusables/search/required_login.md | 2 +- data/reusables/search/syntax_tips.md | 4 +-- .../search/you-can-search-globally.md | 2 +- 20 files changed, 69 insertions(+), 80 deletions(-) diff --git a/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md b/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md index 49980748888c..8017138c8637 100644 --- a/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md +++ b/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md @@ -1,6 +1,6 @@ --- title: About searching on GitHub -intro: 'Our integrated search covers the many repositories, users, and lines of code on {% data variables.product.product_name %}.' +intro: 'Our integrated search covers the many repositories, users, and lines of code on {% data variables.product.github %}.' redirect_from: - /articles/using-the-command-bar - /articles/github-search-basics @@ -22,7 +22,7 @@ topics: {% data reusables.search.you-can-search-globally %} -* To search globally across all of {% data variables.product.product_name %}, type what you're looking for into the search field at the top of any page, and choose "Search all of {% data variables.product.prodname_dotcom %}"{% ifversion fpt or ghec or ghes < 3.12 %} in the search dropdown menu{% endif %}. +* To search globally across all of {% data variables.product.github %}, type what you're looking for into the search field at the top of any page, and choose "Search all of {% data variables.product.prodname_dotcom %}"{% ifversion fpt or ghec or ghes < 3.12 %} in the search dropdown menu{% endif %}. * To search within a particular repository or organization, navigate to the repository or organization page, type what you're looking for into the search field at the top of the page, and press **Enter**. {% ifversion code-search-upgrade %}You can also use suggestions and completions in the search bar to quickly find what you need. @@ -36,13 +36,13 @@ After typing a search query, you can press **Enter** to go to the full search re > [!NOTE] > * {% data reusables.search.required_login %} -> * {% data variables.product.prodname_pages %} sites are not searchable on {% data variables.product.product_name %}. However you can search the source content if it exists in the default branch of a repository, using code search. For more information, see [AUTOTITLE]{% ifversion code-search-upgrade %}(/search-github/github-code-search/understanding-github-code-search-syntax){% else %}(/search-github/searching-on-github/searching-code){% endif %}. For more information about {% data variables.product.prodname_pages %}, see [AUTOTITLE](/pages/getting-started-with-github-pages/about-github-pages) +> * {% data variables.product.prodname_pages %} sites are not searchable on {% data variables.product.github %}. However you can search the source content if it exists in the default branch of a repository, using code search. For more information, see [AUTOTITLE]{% ifversion code-search-upgrade %}(/search-github/github-code-search/understanding-github-code-search-syntax){% else %}(/search-github/searching-on-github/searching-code){% endif %}. For more information about {% data variables.product.prodname_pages %}, see [AUTOTITLE](/pages/getting-started-with-github-pages/about-github-pages) > * Currently our search doesn't support exact matching.{% ifversion ghes %} > * Whenever you are searching in code files, only the first two results in each file will be returned.{% endif %} -After running a search on {% data variables.product.product_name %}, you can sort the results, or further refine them by clicking one of the languages in the sidebar. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/sorting-search-results). +After running a search on {% data variables.product.github %}, you can sort the results, or further refine them by clicking one of the languages in the sidebar. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/sorting-search-results). -{% data variables.product.product_name %} search uses an ElasticSearch cluster to index projects every time a change is pushed to {% data variables.product.product_name %}. Issues and pull requests are indexed when they are created or modified. +{% data variables.product.github %} search uses an ElasticSearch cluster to index projects every time a change is pushed to {% data variables.product.github %}. Issues and pull requests are indexed when they are created or modified. ## Types of searches on {% data variables.product.prodname_dotcom %} @@ -60,7 +60,7 @@ You can search for the following information across all repositories you can acc ## Searching using a visual interface -In addition to the search bar, you can search {% data variables.product.product_name %} using the {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}. {% ifversion command-palette %}Alternatively, you can use the interactive search in the {% data variables.product.prodname_command_palette %} to search your current location in the UI, a specific user, repository or organization, and globally across all of {% data variables.product.product_name %}, without leaving the keyboard. For more information, see [AUTOTITLE](/get-started/accessibility/github-command-palette).{% endif %} +In addition to the search bar, you can search {% data variables.product.github %} using the {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}. {% ifversion command-palette %}Alternatively, you can use the interactive search in the {% data variables.product.prodname_command_palette %} to search your current location in the UI, a specific user, repository or organization, and globally across all of {% data variables.product.github %}, without leaving the keyboard. For more information, see [AUTOTITLE](/get-started/accessibility/github-command-palette).{% endif %} The {% data variables.search.advanced_url %} provides a visual interface for constructing search queries. You can filter your searches by a variety of factors, such as the number of stars or number of forks a repository has. As you fill in the advanced search fields, your query will automatically be constructed in the top search bar. @@ -68,21 +68,15 @@ The {% data variables.search.advanced_url %} provides a visual interface for con ## Searching repositories on {% data variables.product.prodname_dotcom_the_website %} from your private enterprise environment -{% ifversion fpt or ghec %} +If you use {% data variables.product.prodname_dotcom_the_website %} or {% data variables.enterprise.data_residency_site %} as well as {% data variables.product.prodname_ghe_server %}, and an enterprise owner has enabled {% data variables.enterprise.prodname_unified_search %}, you can search across both environments at the same time from {% data variables.product.prodname_ghe_server %}. For more information, see {% ifversion fpt or ghec %}[AUTOTITLE](/enterprise-server@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment) in the {% data variables.product.prodname_ghe_server %} documentation.{% elsif ghes %}[AUTOTITLE](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise). -If you use both {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_ghe_server %}, and an enterprise owner has enabled {% data variables.enterprise.prodname_unified_search %}, you can search across both environments at the same time from {% data variables.product.prodname_ghe_server %}. For more information, see [AUTOTITLE](/enterprise-server@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github#searching-repositories-on-githubcom-from-your-private-enterprise-environment) in the {% data variables.product.prodname_ghe_server %} documentation. +Your enterprise owner on {% data variables.product.prodname_ghe_server %} can separately enable {% data variables.enterprise.prodname_unified_search %} for all public repositories on {% data variables.product.prodname_dotcom_the_website %} and for private repositories owned by the organization or enterprise on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.enterprise.data_residency_site %} that is connected to {% data variables.product.prodname_ghe_server %} through {% data variables.product.prodname_github_connect %}. -{% else %} +Before you can use {% data variables.enterprise.prodname_unified_search %} for private repositories, you must connect your user accounts across environments. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/enabling-githubcom-repository-search-from-your-private-enterprise-environment). -If you use both {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.product_name %}, and an enterprise owner has enabled {% data variables.enterprise.prodname_unified_search %}, you can search across both environments at the same time from {% data variables.product.product_name %}. For more information about how enterprise owners can enable {% data variables.enterprise.prodname_unified_search %}, see [AUTOTITLE](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise). +When you search from {% data variables.product.prodname_ghe_server %}, only private repositories that you have access to and that are owned by the connected organization or enterprise account will be included in search results. Neither you nor anyone else will be able to search private repositories owned by your user account on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.enterprise.data_residency_site %} from {% data variables.product.prodname_ghe_server %}. -Your enterprise owner on {% data variables.product.product_name %} can separately enable {% data variables.enterprise.prodname_unified_search %} for all public repositories on {% data variables.product.prodname_dotcom_the_website %} and for private repositories owned by the organization or enterprise on {% data variables.product.prodname_dotcom_the_website %} that is connected to {% data variables.product.product_name %} through {% data variables.product.prodname_github_connect %}. - -Before you can use {% data variables.enterprise.prodname_unified_search %} for private repositories, you must connect your personal accounts on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.product_name %}. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/enabling-githubcom-repository-search-from-your-private-enterprise-environment). - -When you search from {% data variables.product.product_name %}, only private repositories that you have access to and that are owned by the connected organization or enterprise account will be included in search results. Neither you nor anyone else will be able to search private repositories owned by your personal account on {% data variables.product.prodname_dotcom_the_website %} from {% data variables.product.product_name %}. - -To limit your search to one environment, you can use a filter option on the {% data variables.search.advanced_url %} or you can use the `environment:` search prefix. To only search for content on {% data variables.product.product_name %}, use the search syntax `environment:local`. To only search for content on {% data variables.product.prodname_dotcom_the_website %}, use `environment:github`. +To limit your search to one environment, you can use a filter option on the {% data variables.search.advanced_url %} or you can use the `environment:` search prefix. To only search for content on {% data variables.product.prodname_ghe_server %}, use the search syntax `environment:local`. To only search for content on {% data variables.product.prodname_dotcom_the_website %}, use `environment:github`. {% endif %} ## Further reading diff --git a/content/search-github/getting-started-with-searching-on-github/enabling-repository-search-across-environments.md b/content/search-github/getting-started-with-searching-on-github/enabling-repository-search-across-environments.md index f9b5b84d4157..8cb74629a812 100644 --- a/content/search-github/getting-started-with-searching-on-github/enabling-repository-search-across-environments.md +++ b/content/search-github/getting-started-with-searching-on-github/enabling-repository-search-across-environments.md @@ -20,12 +20,12 @@ You can search for designated private repositories on {% data variables.product. ## Prerequisites -An enterprise owner for {% data variables.product.product_name %} must enable {% data variables.product.prodname_github_connect %} and {% data variables.enterprise.prodname_unified_search %} for private repositories. For more information, see [AUTOTITLE](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise). +An enterprise owner for {% data variables.product.prodname_ghe_server %} must enable {% data variables.product.prodname_github_connect %} and {% data variables.enterprise.prodname_unified_search %} for private repositories. For more information, see [AUTOTITLE](/admin/configuration/configuring-github-connect/enabling-unified-search-for-your-enterprise). -## Enabling unified repository search from {% data variables.product.product_name %} +## Enabling unified repository search from {% data variables.product.prodname_ghe_server %} -1. Sign in to both your user account on {% data variables.product.product_name %} **and** your user account on {% data variables.product.prodname_ghe_cloud %} ({% data variables.product.prodname_dotcom_the_website %}{% ifversion ghecom-github-connect %} or {% data variables.enterprise.data_residency_site %}{% endif %}). -1. On {% data variables.product.product_name %}, in the upper-right corner of any page, click your profile photo, then click **Settings**. +1. Sign in to both your user account on {% data variables.product.prodname_ghe_server %} **and** your user account on {% data variables.product.prodname_ghe_cloud %} ({% data variables.product.prodname_dotcom_the_website %}{% ifversion ghecom-github-connect %} or {% data variables.enterprise.data_residency_site %}{% endif %}). +1. On {% data variables.product.prodname_ghe_server %}, in the upper-right corner of any page, click your profile photo, then click **Settings**. {% ifversion global-nav-update %} diff --git a/content/search-github/getting-started-with-searching-on-github/index.md b/content/search-github/getting-started-with-searching-on-github/index.md index 468592f57db1..784a88ec12ba 100644 --- a/content/search-github/getting-started-with-searching-on-github/index.md +++ b/content/search-github/getting-started-with-searching-on-github/index.md @@ -1,6 +1,6 @@ --- title: Getting started with searching on GitHub -intro: 'You can use a wide range of syntax to search {% data variables.product.product_name %}. You can adjust the scope of your search, build and troubleshoot queries, and sort search results with qualifiers.' +intro: 'You can use a wide range of syntax to search {% data variables.product.github %}. You can adjust the scope of your search, build and troubleshoot queries, and sort search results with qualifiers.' redirect_from: - /articles/getting-started-with-searching-on-github - /github/searching-for-information-on-github/getting-started-with-searching-on-github @@ -18,4 +18,3 @@ children: - /enabling-repository-search-across-environments shortTitle: Start with search on GitHub --- - diff --git a/content/search-github/getting-started-with-searching-on-github/sorting-search-results.md b/content/search-github/getting-started-with-searching-on-github/sorting-search-results.md index 34f80fd5f365..4f6afafe5951 100644 --- a/content/search-github/getting-started-with-searching-on-github/sorting-search-results.md +++ b/content/search-github/getting-started-with-searching-on-github/sorting-search-results.md @@ -1,6 +1,6 @@ --- title: Sorting search results -intro: 'You can sort [{% data variables.product.product_name %} search](/articles/searching-on-github) results using the Sort menu, or by adding a `sort` qualifier to your query.' +intro: 'You can sort {% data variables.product.github %} search results using the Sort menu, or by adding a `sort` qualifier to your query.' redirect_from: - /articles/sorting-search-results - /github/searching-for-information-on-github/sorting-search-results @@ -16,7 +16,7 @@ topics: {% ifversion code-search-upgrade %} > [!NOTE] -> Sorting search results is not supported for {% data variables.product.product_name %} code search. For more information on code search, see [AUTOTITLE](/search-github/github-code-search/about-github-code-search). +> Sorting search results is not supported for {% data variables.product.github %} code search. For more information on code search, see [AUTOTITLE](/search-github/github-code-search/about-github-code-search). {% endif %} @@ -30,8 +30,8 @@ The `sort:interactions` qualifier sorts by the highest combined number of reacti | Qualifier | Example | ------------- | ------------- -| `sort:interactions` or `sort:interactions-desc` | [**org:github sort:interactions**](https://github.com/search?q=org%3Agithub+sort%3Ainteractions&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by the highest combined number of reactions and comments. -| `sort:interactions-asc` | [**org:github sort:interactions-asc**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Ainteractions-asc&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by the lowest combined number of reactions and comments. +| `sort:interactions` or `sort:interactions-desc` | [**org:github sort:interactions**](https://github.com/search?q=org%3Agithub+sort%3Ainteractions&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by the highest combined number of reactions and comments. +| `sort:interactions-asc` | [**org:github sort:interactions-asc**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Ainteractions-asc&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by the lowest combined number of reactions and comments. ## Sort by reactions @@ -39,13 +39,13 @@ The `sort:reactions` qualifier sorts by the number or type of reactions. | Qualifier | Example | ------------- | ------------- -| `sort:reactions` or `sort:reactions-desc` | [**org:github sort:reactions**](https://github.com/search?q=org%3Agithub+sort%3Areactions&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by the highest number of reactions. -| `sort:reactions-asc` | [**org:github sort:reactions-asc**](https://github.com/search?q=org%3Agithub+sort%3Areactions-asc&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by ascending number of reactions (the fewest to the most). -| sort:reactions-reaction | [**org:github sort:reactions-+1**](https://github.com/search?q=org%3Agithub+sort%3Areactions-%2B1&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by most thumbs up (:+1:) reactions. -| sort:reactions-reaction | [**org:github sort:reactions--1**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions--1&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by most thumbs down (:-1:) reactions. -| sort:reactions-reaction | [**org:github sort:reactions-smile**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-smile&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by most laugh (:smile:) reactions. -| sort:reactions-reaction | [**org:github sort:reactions-tada**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-tada&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by most hurray (:tada:) reactions. -| sort:reactions-reaction | [**org:github sort:reactions-heart**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-heart&type=Issues) matches issues in repositories owned by {% data variables.product.product_name %}, sorted by most heart (:heart:) reactions. +| `sort:reactions` or `sort:reactions-desc` | [**org:github sort:reactions**](https://github.com/search?q=org%3Agithub+sort%3Areactions&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by the highest number of reactions. +| `sort:reactions-asc` | [**org:github sort:reactions-asc**](https://github.com/search?q=org%3Agithub+sort%3Areactions-asc&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by ascending number of reactions (the fewest to the most). +| sort:reactions-reaction | [**org:github sort:reactions-+1**](https://github.com/search?q=org%3Agithub+sort%3Areactions-%2B1&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by most thumbs up (:+1:) reactions. +| sort:reactions-reaction | [**org:github sort:reactions--1**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions--1&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by most thumbs down (:-1:) reactions. +| sort:reactions-reaction | [**org:github sort:reactions-smile**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-smile&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by most laugh (:smile:) reactions. +| sort:reactions-reaction | [**org:github sort:reactions-tada**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-tada&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by most hurray (:tada:) reactions. +| sort:reactions-reaction | [**org:github sort:reactions-heart**](https://github.com/search?utf8=%E2%9C%93&q=org%3Agithub+sort%3Areactions-heart&type=Issues) matches issues in repositories owned by {% data variables.product.github %}, sorted by most heart (:heart:) reactions. ## Sort by author date @@ -53,8 +53,8 @@ The `sort:author-date` qualifier sorts by descending or ascending author date. | Qualifier | Example | ------------- | ------------- -| `sort:author-date` or `sort:author-date-desc` | [**feature org:github sort:author-date**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Aauthor-date&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.product_name %}, sorted by descending author date. -| `sort:author-date-asc` | [**`feature org:github sort:author-date-asc`**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Aauthor-date-asc&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.product_name %}, sorted by ascending author date. +| `sort:author-date` or `sort:author-date-desc` | [**feature org:github sort:author-date**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Aauthor-date&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.github %}, sorted by descending author date. +| `sort:author-date-asc` | [**`feature org:github sort:author-date-asc`**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Aauthor-date-asc&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.github %}, sorted by ascending author date. ## Sort by committer date @@ -62,8 +62,8 @@ The `sort:committer-date` qualifier sorts by descending or ascending committer d | Qualifier | Example | ------------- | ------------- -| `sort:committer-date` or `sort:committer-date-desc` | [**feature org:github sort:committer-date**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Acommitter-date&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.product_name %}, sorted by descending committer date. -| `sort:committer-date-asc` | [**`feature org:github sort:committer-date-asc`**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Acommitter-date-asc&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.product_name %}, sorted by ascending committer date. +| `sort:committer-date` or `sort:committer-date-desc` | [**feature org:github sort:committer-date**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Acommitter-date&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.github %}, sorted by descending committer date. +| `sort:committer-date-asc` | [**`feature org:github sort:committer-date-asc`**](https://github.com/search?utf8=%E2%9C%93&q=feature+org%3Agithub+sort%3Acommitter-date-asc&type=Commits) matches commits containing the word "feature" in repositories owned by {% data variables.product.github %}, sorted by ascending committer date. ## Sort by updated date diff --git a/content/search-github/getting-started-with-searching-on-github/troubleshooting-search-queries.md b/content/search-github/getting-started-with-searching-on-github/troubleshooting-search-queries.md index 408829861542..9c171464b1aa 100644 --- a/content/search-github/getting-started-with-searching-on-github/troubleshooting-search-queries.md +++ b/content/search-github/getting-started-with-searching-on-github/troubleshooting-search-queries.md @@ -1,6 +1,6 @@ --- title: Troubleshooting search queries -intro: 'If you encounter unexpected results while searching on {% data variables.product.product_name %}, you can troubleshoot by reviewing common problems and limitations.' +intro: 'If you encounter unexpected results while searching on {% data variables.product.github %}, you can troubleshoot by reviewing common problems and limitations.' redirect_from: - /articles/troubleshooting-search-queries - /github/searching-for-information-on-github/troubleshooting-search-queries @@ -21,7 +21,7 @@ Reaching a timeout does not necessarily mean that search results are incomplete. ## Limitations on query length -There are some limits to the length of the queries when searching across {% data variables.product.product_name %}: +There are some limits to the length of the queries when searching across {% data variables.product.github %}: * Queries longer than 256 characters are not supported * You can't construct a query using more than five `AND`, `OR`, or `NOT` operators diff --git a/content/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax.md b/content/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax.md index c44fc209950a..70e6ce7a8b01 100644 --- a/content/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax.md +++ b/content/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax.md @@ -1,6 +1,6 @@ --- title: Understanding the search syntax -intro: 'When searching {% data variables.product.product_name %}, you can construct queries that match specific numbers and words.' +intro: 'When searching {% data variables.product.github %}, you can construct queries that match specific numbers and words.' redirect_from: - /articles/search-syntax - /articles/understanding-the-search-syntax @@ -97,7 +97,7 @@ If your search query contains whitespace, you will need to surround it with quot ## Queries with usernames -If your search query contains a qualifier that requires a username, such as `user`, `actor`, or `assignee`, you can use any {% data variables.product.product_name %} username to specify a specific person{% ifversion copilot %}, `@me` to specify the current user, or `@copilot` to specify {% data variables.product.prodname_copilot_short %}.{% else %} or `@me`, to specify the current user.{% endif %} +If your search query contains a qualifier that requires a username, such as `user`, `actor`, or `assignee`, you can use any valid username to specify a specific person{% ifversion copilot %}, `@me` to specify the current user, or `@copilot` to specify {% data variables.product.prodname_copilot_short %}.{% else %} or `@me`, to specify the current user.{% endif %} | Query | Example | | ------ | ------- | diff --git a/content/search-github/searching-on-github/finding-files-on-github.md b/content/search-github/searching-on-github/finding-files-on-github.md index 57db91da48af..b836eee94490 100644 --- a/content/search-github/searching-on-github/finding-files-on-github.md +++ b/content/search-github/searching-on-github/finding-files-on-github.md @@ -1,6 +1,6 @@ --- title: Finding files on GitHub -intro: 'You can search for a file in a repository using the file finder. To search for a file in multiple repositories on {% data variables.product.product_name %}, use the {% ifversion code-search-upgrade %}[`path` code search qualifier](/search-github/github-code-search/understanding-github-code-search-syntax#path-qualifier){% else %}[`filename` code search qualifier](/search-github/searching-on-github/searching-code#search-by-filename){% endif %}.' +intro: 'You can search for a file in a repository using the file finder. To search for a file in multiple repositories on {% data variables.product.github %}, use the {% ifversion code-search-upgrade %}[`path` code search qualifier](/search-github/github-code-search/understanding-github-code-search-syntax#path-qualifier){% else %}[`filename` code search qualifier](/search-github/searching-on-github/searching-code#search-by-filename){% endif %}.' redirect_from: - /articles/finding-files-on-github - /github/searching-for-information-on-github/finding-files-on-github diff --git a/content/search-github/searching-on-github/searching-code.md b/content/search-github/searching-on-github/searching-code.md index 4e54102b960a..d5fb9c92f8b9 100644 --- a/content/search-github/searching-on-github/searching-code.md +++ b/content/search-github/searching-on-github/searching-code.md @@ -1,6 +1,6 @@ --- title: Searching code {% ifversion code-search-upgrade %}(legacy){% endif %} -intro: '{% ifversion code-search-upgrade %}You only need to use the legacy code search syntax if you are using the code search API{% else %}You can search for code on {% data variables.product.product_name %} and narrow the results using these code search qualifiers in any combination{% endif %}.' +intro: '{% ifversion code-search-upgrade %}You only need to use the legacy code search syntax if you are using the code search API{% else %}You can search for code on {% data variables.product.github %} and narrow the results using these code search qualifiers in any combination{% endif %}.' redirect_from: - /articles/searching-code - /github/searching-for-information-on-github/searching-files-in-a-repository-for-exact-matches diff --git a/content/search-github/searching-on-github/searching-commits.md b/content/search-github/searching-on-github/searching-commits.md index 6c3be04a4a11..4bfcec2d0d28 100644 --- a/content/search-github/searching-on-github/searching-commits.md +++ b/content/search-github/searching-on-github/searching-commits.md @@ -1,6 +1,6 @@ --- title: Searching commits -intro: 'You can search for commits on {% data variables.product.product_name %} and narrow the results using these commit search qualifiers in any combination.' +intro: 'You can search for commits on {% data variables.product.github %} and narrow the results using these commit search qualifiers in any combination.' redirect_from: - /articles/searching-commits - /github/searching-for-information-on-github/searching-commits @@ -12,7 +12,7 @@ versions: topics: - GitHub search --- -You can search for commits globally across all of {% data variables.product.product_name %}, or search for commits within a particular repository or organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search for commits globally across all of {% data variables.product.github %}, or search for commits within a particular repository or organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). When you search for commits, only the [default branch](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) of a repository is searched. diff --git a/content/search-github/searching-on-github/searching-discussions.md b/content/search-github/searching-on-github/searching-discussions.md index 4d7f5764b06d..a114cf20adc7 100644 --- a/content/search-github/searching-on-github/searching-discussions.md +++ b/content/search-github/searching-on-github/searching-discussions.md @@ -1,6 +1,6 @@ --- title: Searching discussions -intro: 'You can search for discussions on {% data variables.product.product_name %} and narrow the results using search qualifiers.' +intro: 'You can search for discussions on {% data variables.product.github %} and narrow the results using search qualifiers.' versions: fpt: '*' ghes: '*' @@ -14,13 +14,13 @@ redirect_from: ## About searching for discussions -You can search for discussions globally across all of {% data variables.product.product_name %}, or search for discussions within a particular organization or repository. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search for discussions globally across all of {% data variables.product.github %}, or search for discussions within a particular organization or repository. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). {% data reusables.search.syntax_tips %} ## Search by the title, body, or comments -With the `in` qualifier you can restrict your search for discussions to the title, body, or comments. You can also combine qualifiers to search a combination of title, body, or comments. When you omit the `in` qualifier, {% data variables.product.product_name %} searches the title, body, and comments. +With the `in` qualifier you can restrict your search for discussions to the title, body, or comments. You can also combine qualifiers to search a combination of title, body, or comments. When you omit the `in` qualifier, {% data variables.product.github %} searches the title, body, and comments. | Qualifier | Example | | :- | :- | diff --git a/content/search-github/searching-on-github/searching-for-packages.md b/content/search-github/searching-on-github/searching-for-packages.md index 8a8ef18b45c6..d297c5c784e9 100644 --- a/content/search-github/searching-on-github/searching-for-packages.md +++ b/content/search-github/searching-on-github/searching-for-packages.md @@ -1,6 +1,6 @@ --- title: Searching for packages -intro: 'You can search for packages on {% data variables.product.product_name %} and narrow the results using search qualifiers.' +intro: 'You can search for packages on {% data variables.product.github %} and narrow the results using search qualifiers.' product: '{% data reusables.gated-features.packages %}' permissions: Anyone can search for packages they have access to. versions: @@ -17,10 +17,10 @@ redirect_from: ## About searching for packages -You can search for packages globally across all of {% data variables.product.product_name %}, or search for packages within a particular organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search for packages globally across all of {% data variables.product.github %}, or search for packages within a particular organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). {% ifversion ghes %} -You can only search for packages on {% data variables.product.product_name %}, not {% data variables.product.prodname_dotcom_the_website %}, even if {% data variables.product.prodname_github_connect %} is enabled. +You can only search for packages on {% data variables.product.prodname_ghe_server %}, not {% data variables.product.prodname_dotcom_the_website %}, even when {% data variables.product.prodname_github_connect %} is enabled. {% endif %} {% data reusables.search.syntax_tips %} diff --git a/content/search-github/searching-on-github/searching-for-repositories.md b/content/search-github/searching-on-github/searching-for-repositories.md index 211ccf86598b..c0db21c34a36 100644 --- a/content/search-github/searching-on-github/searching-for-repositories.md +++ b/content/search-github/searching-on-github/searching-for-repositories.md @@ -1,6 +1,6 @@ --- title: Searching for repositories -intro: 'You can search for repositories on {% data variables.product.product_name %} and narrow the results using these repository search qualifiers in any combination.' +intro: 'You can search for repositories on {% data variables.product.github %} and narrow the results using these repository search qualifiers in any combination.' redirect_from: - /articles/searching-repositories - /articles/searching-for-repositories diff --git a/content/search-github/searching-on-github/searching-gists.md b/content/search-github/searching-on-github/searching-gists.md index 45c9ebae2fb9..eda4ac0f86bb 100644 --- a/content/search-github/searching-on-github/searching-gists.md +++ b/content/search-github/searching-on-github/searching-gists.md @@ -1,6 +1,6 @@ --- title: Searching gists -intro: 'You can search for gists on {% data variables.product.product_name %} and narrow the results using search qualifiers.' +intro: 'You can search for gists on {% data variables.product.github %} and narrow the results using search qualifiers.' permissions: '{% data reusables.enterprise-accounts.emu-permission-gist %}' versions: fpt: '*' @@ -10,7 +10,7 @@ versions: ## Search gists -You can search for gists globally across all of {% data variables.product.product_name %}. +You can search for gists globally across {% data variables.location.product_location %}. | Qualifier | Example | | :- | :- | 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 8a5cf00bfbff..62bb5bbc7480 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 @@ -1,6 +1,6 @@ --- title: Searching issues and pull requests -intro: 'You can search for issues and pull requests on {% data variables.product.product_name %} and narrow the results using these search qualifiers in any combination.' +intro: 'You can search for issues and pull requests on {% data variables.product.github %} and narrow the results using these search qualifiers in any combination.' redirect_from: - /articles/searching-issues - /articles/searching-issues-and-pull-requests @@ -14,15 +14,11 @@ topics: - GitHub search shortTitle: Search issues & PRs --- -You can search for issues and pull requests globally across all of {% data variables.product.product_name %}, or search for issues and pull requests within a particular organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search for issues and pull requests globally across all of {% data variables.product.github %}, or search for issues and pull requests within a particular organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). > [!TIP] -{% ifversion ghes %} -> * 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 %} -{% ifversion issues-advanced-search %} -> * You can build advanced filters using boolean and nested queries on your repository's issues page. See [AUTOTITLE](/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests#building-advanced-filters-for-issues). -{% endif %} +> * This article contains example searches on {% data variables.product.prodname_dotcom_the_website %}, but you can use the same search filters on other {% data variables.product.github %} platforms.{% ifversion issues-advanced-search %} +> * You can build advanced filters using boolean and nested queries on your repository's issues page. See [AUTOTITLE](/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests#building-advanced-filters-for-issues).{% 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. Note that this does not work for [missing metadata qualifiers](#search-by-missing-metadata). @@ -30,7 +26,7 @@ You can search for issues and pull requests globally across all of {% data varia ## Search only issues or pull requests -By default, {% data variables.product.product_name %} search will return both issues and pull requests. However, you can restrict search results to just issues or pull requests using the `type` or `is` qualifier. +By default, {% data variables.product.github %} search will return both issues and pull requests. However, you can restrict search results to just issues or pull requests using the `type` or `is` qualifier. | Qualifier | Example | ------------- | ------------- diff --git a/content/search-github/searching-on-github/searching-topics.md b/content/search-github/searching-on-github/searching-topics.md index f9529a9367b9..99cd0aaefbae 100644 --- a/content/search-github/searching-on-github/searching-topics.md +++ b/content/search-github/searching-on-github/searching-topics.md @@ -1,6 +1,6 @@ --- title: Searching topics -intro: 'You can search for topics associated with repositories on {% data variables.product.product_name %}.' +intro: 'You can search for topics associated with repositories on {% data variables.product.github %}.' redirect_from: - /articles/searching-topics - /github/searching-for-information-on-github/searching-topics @@ -12,11 +12,11 @@ versions: topics: - GitHub search --- -## Search {% data variables.product.product_name %} for topics +## Search {% data variables.product.github %} for topics -You can search for topics on {% data variables.product.product_name %}, explore related topics, and see how many repositories are associated with a certain topic. +You can search for topics on {% data variables.product.github %}, explore related topics, and see how many repositories are associated with a certain topic. -1. Navigate to https://github.com/search. +1. Navigate to {% data variables.search.search_page_url %}. 1. Type a topic keyword. 1. In the left sidebar, to narrow your search to topics, click **Topics**. {% ifversion fpt or ghec %} @@ -24,9 +24,9 @@ You can search for topics on {% data variables.product.product_name %}, explore ## Narrowing your search with search qualifiers -If you want to explore repositories about a certain topic, find projects to contribute to, or learn which topics are most popular on {% data variables.product.product_name %}, you can search topics with the search qualifiers `is:featured`, `is:curated`, `repositories:n` and `created:YYYY-MM-DD`. +If you want to explore repositories about a certain topic, find projects to contribute to, or learn which topics are most popular on {% data variables.product.github %}, you can search topics with the search qualifiers `is:featured`, `is:curated`, `repositories:n` and `created:YYYY-MM-DD`. -The `is:featured` search qualifier will narrow search results to the topics with the most repositories on {% data variables.product.product_name %}. These topics are also featured at https://github.com/topics/. +The `is:featured` search qualifier will narrow search results to the topics with the most repositories on {% data variables.product.github %}. These topics are also featured at https://github.com/topics/. The `is:curated` search qualifier will narrow search results to topics that community members have added extra information to. For more information, see the [explore repository](https://github.com/github/explore). diff --git a/content/search-github/searching-on-github/searching-users.md b/content/search-github/searching-on-github/searching-users.md index 3d3d6b8598ba..ef0fe3d43304 100644 --- a/content/search-github/searching-on-github/searching-users.md +++ b/content/search-github/searching-on-github/searching-users.md @@ -1,6 +1,6 @@ --- title: Searching users -intro: 'You can search for users on {% data variables.product.product_name %} and narrow the results using these user search qualifiers in any combination.' +intro: 'You can search for users on {% data variables.product.github %} and narrow the results using these user search qualifiers in any combination.' redirect_from: - /articles/searching-users - /github/searching-for-information-on-github/searching-users @@ -12,7 +12,9 @@ versions: topics: - GitHub search --- -You can search for users globally across all of {% data variables.product.product_name %}. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search for users globally across a {% data variables.product.github %} platform, for example: across {% data variables.product.prodname_dotcom_the_website %} or across {% data variables.product.prodname_ghe_server %}. + +For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). {% data reusables.search.syntax_tips %} @@ -68,7 +70,7 @@ Using the `language` qualifier you can search for users based on the languages o ## Search by when a personal account was created -You can filter users based on when they joined {% data variables.product.product_name %} with the `created` qualifier. This takes a date as its parameter. {% data reusables.time_date.date_format %} {% data reusables.time_date.time_format %} +You can filter users based on when they joined {% data variables.product.github %} with the `created` qualifier. This takes a date as its parameter. {% data reusables.time_date.date_format %} {% data reusables.time_date.time_format %} {% data reusables.search.date_gt_lt %} diff --git a/content/search-github/searching-on-github/searching-wikis.md b/content/search-github/searching-on-github/searching-wikis.md index 10b83ab4ede1..0f7299ba880f 100644 --- a/content/search-github/searching-on-github/searching-wikis.md +++ b/content/search-github/searching-on-github/searching-wikis.md @@ -1,6 +1,6 @@ --- title: Searching wikis -intro: 'You can search wikis on {% data variables.product.product_name %} and narrow the results using these wiki search qualifiers in any combination.' +intro: 'You can search wikis on {% data variables.product.github %} and narrow the results using these wiki search qualifiers in any combination.' redirect_from: - /articles/searching-wikis - /github/searching-for-information-on-github/searching-wikis @@ -12,7 +12,7 @@ versions: topics: - GitHub search --- -You can search wikis globally across all of {% data variables.product.product_name %}, or search wikis within a particular repository or organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). +You can search wikis globally across all of {% data variables.product.github %}, or search wikis within a particular repository or organization. For more information, see [AUTOTITLE](/search-github/getting-started-with-searching-on-github/about-searching-on-github). {% data reusables.search.syntax_tips %} diff --git a/data/reusables/search/required_login.md b/data/reusables/search/required_login.md index f42f37507f96..e5aeff8b5520 100644 --- a/data/reusables/search/required_login.md +++ b/data/reusables/search/required_login.md @@ -1 +1 @@ -You must be signed into a personal account on {% data variables.product.product_name %} to search for code across all public repositories. +You must be signed into a personal account on {% data variables.product.github %} to search for code across all public repositories. diff --git a/data/reusables/search/syntax_tips.md b/data/reusables/search/syntax_tips.md index 4ff59b106870..f84194051a49 100644 --- a/data/reusables/search/syntax_tips.md +++ b/data/reusables/search/syntax_tips.md @@ -1,6 +1,4 @@ > [!TIP] -{% ifversion ghes %} -> * This article contains links to example searches on the {% data variables.product.prodname_dotcom_the_website %} website, but you can use the same search filters with {% data variables.product.product_name %}. In the linked example searches, replace `github.com` with the hostname for {% data variables.location.product_location %}. -{% endif %} +> * This article contains links to example searches on the {% data variables.product.prodname_dotcom_the_website %} website, but you can use the same search filters in any {% data variables.product.github %} platform. In the linked example searches, replace `github.com` with the hostname for your {% data variables.product.github %} platform. > * 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. diff --git a/data/reusables/search/you-can-search-globally.md b/data/reusables/search/you-can-search-globally.md index dd690bc80fe1..cf225e0c7f4c 100644 --- a/data/reusables/search/you-can-search-globally.md +++ b/data/reusables/search/you-can-search-globally.md @@ -1 +1 @@ -You can search globally across all of {% data variables.product.product_name %}, or scope your search to a particular repository or organization. +You can search globally across all of {% data variables.product.github %}, or scope your search to a particular repository or organization. From f27c521efe4434af2ab3c58ad3cc88fb2bb23629 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Wed, 22 Jan 2025 10:10:55 -0500 Subject: [PATCH 2/2] Use review server URL for content changes table (#53812) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kevin Heis Co-authored-by: Evan Bonsignori --- .github/workflows/code-changes-comment.yml | 66 +++++++++++++++++++ .../content-changes-table-comment.yml | 29 ++++---- .../content-changes-table-comment.ts | 45 ++++++++----- 3 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/code-changes-comment.yml diff --git a/.github/workflows/code-changes-comment.yml b/.github/workflows/code-changes-comment.yml new file mode 100644 index 000000000000..060d4467c9b0 --- /dev/null +++ b/.github/workflows/code-changes-comment.yml @@ -0,0 +1,66 @@ +name: Code changes comment + +# **What it does**: When a PR is opened in docs-internal or docs containing code, it comments with instructions on how to deploy and preview the changes. +# **Why we have it**: To help Docs contributors understand how to preview their changes. +# **Who does it impact**: docs-internal and docs maintainers and contributors + +on: + # Required in lieu of `pull_request` so that the comment can be posted to PRs opened from a fork. + pull_request_target: + types: + - opened + - synchronize + # this applies to any non-content files, this workflow will run for all changed files unless it's ONLY these content-related changes + paths-ignore: + - 'content/**' + - 'data/reusables/**' + - 'assets/images/**' + +permissions: + contents: read + pull-requests: write + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + postOnCodeChanges: + if: ${{ github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') }} + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: check out repo content + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Find code changes comment + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e + id: findComment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: '' + + # TODO: We'll update this comment at a later time with permament-ish links to deployment instructions. + - name: Comment on code changes + if: ${{ !steps.findComment.outputs.comment-id }} + run: | + if [[ "${{ github.repository }}" == "github/docs" ]]; then + COMMENT_BODY=" + ## 🚀 Manual Deployment Required + + It looks like this pull request contains code changes. To preview these changes, an internal Hubber will need to manually deploy the changes to one of our staging servers. + + Thank you for your contribution!" + else + COMMENT_BODY=" + ## 🚀 Manual Deployment Required + + It looks like this pull request contains code changes. To preview these changes, you will need to deploy them manually. + + Thank you for your contribution!" + fi + + gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT_BODY" diff --git a/.github/workflows/content-changes-table-comment.yml b/.github/workflows/content-changes-table-comment.yml index d394b59e7cdf..a9d28f872d30 100644 --- a/.github/workflows/content-changes-table-comment.yml +++ b/.github/workflows/content-changes-table-comment.yml @@ -28,6 +28,7 @@ on: paths: - 'content/**' - 'data/reusables/**' + - 'assets/images/**' permissions: contents: read @@ -48,21 +49,28 @@ jobs: - name: check out repo content uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Get preview app info - env: - APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }} - run: src/workflows/get-preview-app-info.sh - - uses: ./.github/actions/node-npm-setup + # We're setting the URLs manually until we merge in-progress work. We can utilize review server and its helper functions in a later iteration. + - name: Set APP_URL + run: | + if [[ "${{ github.repository }}" == "github/docs-internal" ]]; then + echo "APP_URL=https://docs-review.github.com" >> $GITHUB_ENV + elif [[ "${{ github.repository }}" == "github/docs" ]]; then + echo "APP_URL=https://os-docs-review.github.com" >> $GITHUB_ENV + fi + - name: Get changes table id: changes timeout-minutes: 30 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEW_SERVER_ACCESS_TOKEN: ${{ secrets.REVIEW_SERVER_ACCESS_TOKEN }} APP_URL: ${{ env.APP_URL }} BASE_SHA: ${{ github.event.pull_request.base.sha || inputs.BASE_SHA }} HEAD_SHA: ${{ github.event.pull_request.head.sha || inputs.HEAD_SHA }} + # HEAD_BRANCH isn't necessary for the table comment, but lets us list the branch in the review server menu bar + HEAD_BRANCH: ${{ github.event.pull_request.head.ref }} run: npm run content-changes-table-comment - name: Find content directory changes comment @@ -81,10 +89,10 @@ jobs: issue-number: ${{ github.event.pull_request.number || inputs.PR_NUMBER }} body: | - ## Automatically generated comment ℹī¸ - **This comment is automatically generated and will be overwritten every time changes are committed to this branch.** + ## 👓 Previews for changed content + **This comment is 🤖 automatically generated and will be overwritten every time changes are committed to this branch.** - The table contains an overview of files in the `content` directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the `data` directory will not show up in this table. + The table contains an overview of files in the `content` directory that have been changed in this pull request. It's provided to make it easy to review your changes on the review server. Please note that changes to the `data` directory will not show up in this table. --- @@ -93,7 +101,6 @@ jobs: ${{ steps.changes.outputs.changesTable }} --- - fpt: Free, Pro, Team - ghec: GitHub Enterprise Cloud - ghes: GitHub Enterprise Server + Key: **fpt**: Free, Pro, Team; **ghec**: GitHub Enterprise Cloud; **ghes**: GitHub Enterprise Server + _This table is posted from the [${{ github.workflow }}](https://github.com/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/content-changes-table-comment.yml) workflow._ edit-mode: replace diff --git a/src/workflows/content-changes-table-comment.ts b/src/workflows/content-changes-table-comment.ts index d9531d0f6b0f..28647cb4c382 100755 --- a/src/workflows/content-changes-table-comment.ts +++ b/src/workflows/content-changes-table-comment.ts @@ -1,5 +1,3 @@ -#!/usr/bin/env node - /** * Hi there! 👋 * To test this code locally, outside of Actions, you need to run @@ -23,11 +21,10 @@ import { getContents } from './git-utils.js' import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' import { allVersionShortnames } from '@/versions/lib/all-versions.js' -import { waitUntilUrlIsHealthy } from './wait-until-url-is-healthy.js' import readFrontmatter from '@/frame/lib/read-frontmatter.js' import { inLiquid } from './lib/in-liquid' -const { GITHUB_TOKEN, APP_URL } = process.env +const { GITHUB_TOKEN, REVIEW_SERVER_ACCESS_TOKEN, APP_URL } = process.env const context = github.context // the max size of the comment (in bytes) @@ -44,13 +41,8 @@ if (import.meta.url.endsWith(process.argv[1])) { const baseSHA = process.env.BASE_SHA || context.payload.pull_request!.base.sha const headSHA = process.env.HEAD_SHA || context.payload.pull_request!.head.sha - const isHealthy = await waitUntilUrlIsHealthy(new URL('/healthz', APP_URL).toString()) - if (!isHealthy) { - core.setFailed(`Timeout waiting for preview environment: ${APP_URL}`) - } else { - const markdownTable = await main(owner, repo, baseSHA, headSHA) - core.setOutput('changesTable', markdownTable) - } + const markdownTable = await main(owner, repo, baseSHA, headSHA) + core.setOutput('changesTable', markdownTable) } async function main(owner: string, repo: string, baseSHA: string, headSHA: string) { @@ -60,10 +52,30 @@ async function main(owner: string, repo: string, baseSHA: string, headSHA: strin if (!APP_URL) { throw new Error(`APP_URL environment variable not set`) } + const headBranch = process.env.HEAD_BRANCH + const RetryingOctokit = Octokit.plugin(retry) const octokit = new RetryingOctokit({ auth: `token ${GITHUB_TOKEN}`, }) + + // we'll attach the branch or sha right after this + const searchParams = new URLSearchParams({ + 'review-server-repository': `${owner}/${repo}`, + }) + + // this token will be available in the internal repo only, skip it for the open source repo + if (REVIEW_SERVER_ACCESS_TOKEN) + searchParams.append('review-server-access-token', REVIEW_SERVER_ACCESS_TOKEN) + + // this script compares with SHAs only, so this allows us + // to surface the branch name for the review server bar + headBranch + ? searchParams.append('review-server-branch', headBranch) + : searchParams.append('review-server-sha', headSHA) + + const queryParams = `?${searchParams.toString()}` + // get the list of file changes from the PR const response = await octokit.rest.repos.compareCommitsWithBasehead({ owner, @@ -134,7 +146,7 @@ async function main(owner: string, repo: string, baseSHA: string, headSHA: strin return } - return makeRow({ file, fileName, sourceUrl, fileUrl, data }) + return makeRow({ file, fileName, sourceUrl, fileUrl, queryParams, data }) }), ) @@ -149,6 +161,7 @@ async function main(owner: string, repo: string, baseSHA: string, headSHA: strin fileName, sourceUrl: file.blob_url, fileUrl, + queryParams, data, fromReusable: true, }) @@ -194,6 +207,7 @@ type File = { function makeRow({ file, fileUrl, + queryParams, fileName, sourceUrl, data, @@ -201,6 +215,7 @@ function makeRow({ }: { file: File fileUrl: string + queryParams: string fileName: string sourceUrl: string data: any @@ -235,12 +250,12 @@ function makeRow({ if (versions.toString() === nonEnterpriseDefaultVersion) { // omit version from fpt url - previewCell += `[${plan}](${APP_URL}/${fileUrl})
` + previewCell += `[${plan}](${APP_URL}/${fileUrl}${queryParams})
` prodCell += `[${plan}](${PROD_URL}/${fileUrl})
` } else { // for non-versioned releases (ghec) use full url - previewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl})
` + previewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl}${queryParams})
` prodCell += `[${plan}](${PROD_URL}/${versions}/${fileUrl})
` } } else if (versions.length) { @@ -250,7 +265,7 @@ function makeRow({ prodCell += `${plan}@ ` versions.forEach((version) => { - previewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) ` + previewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}${queryParams}) ` prodCell += `[${version.split('@')[1]}](${PROD_URL}/${version}/${fileUrl}) ` }) previewCell += '
'