Skip to content

Commit e6215fb

Browse files
authored
Merge pull request #36027 from github/repo-sync
Repo sync
2 parents 3c4b3f7 + f27c521 commit e6215fb

23 files changed

+183
-106
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Code changes comment
2+
3+
# **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.
4+
# **Why we have it**: To help Docs contributors understand how to preview their changes.
5+
# **Who does it impact**: docs-internal and docs maintainers and contributors
6+
7+
on:
8+
# Required in lieu of `pull_request` so that the comment can be posted to PRs opened from a fork.
9+
pull_request_target:
10+
types:
11+
- opened
12+
- synchronize
13+
# this applies to any non-content files, this workflow will run for all changed files unless it's ONLY these content-related changes
14+
paths-ignore:
15+
- 'content/**'
16+
- 'data/reusables/**'
17+
- 'assets/images/**'
18+
19+
permissions:
20+
contents: read
21+
pull-requests: write
22+
23+
# This allows a subsequently queued workflow run to interrupt previous runs
24+
concurrency:
25+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
26+
cancel-in-progress: true
27+
28+
jobs:
29+
postOnCodeChanges:
30+
if: ${{ github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') }}
31+
runs-on: ubuntu-latest
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
steps:
35+
- name: check out repo content
36+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
38+
- name: Find code changes comment
39+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
40+
id: findComment
41+
with:
42+
issue-number: ${{ github.event.pull_request.number }}
43+
comment-author: 'github-actions[bot]'
44+
body-includes: '<!-- CODE_CHANGES_COMMENT -->'
45+
46+
# TODO: We'll update this comment at a later time with permament-ish links to deployment instructions.
47+
- name: Comment on code changes
48+
if: ${{ !steps.findComment.outputs.comment-id }}
49+
run: |
50+
if [[ "${{ github.repository }}" == "github/docs" ]]; then
51+
COMMENT_BODY="<!-- CODE_CHANGES_COMMENT -->
52+
## 🚀 Manual Deployment Required
53+
54+
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.
55+
56+
Thank you for your contribution!"
57+
else
58+
COMMENT_BODY="<!-- CODE_CHANGES_COMMENT -->
59+
## 🚀 Manual Deployment Required
60+
61+
It looks like this pull request contains code changes. To preview these changes, you will need to deploy them manually.
62+
63+
Thank you for your contribution!"
64+
fi
65+
66+
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT_BODY"

.github/workflows/content-changes-table-comment.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ on:
2828
paths:
2929
- 'content/**'
3030
- 'data/reusables/**'
31+
- 'assets/images/**'
3132

3233
permissions:
3334
contents: read
@@ -48,21 +49,28 @@ jobs:
4849
- name: check out repo content
4950
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5051

51-
- name: Get preview app info
52-
env:
53-
APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }}
54-
run: src/workflows/get-preview-app-info.sh
55-
5652
- uses: ./.github/actions/node-npm-setup
5753

54+
# 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.
55+
- name: Set APP_URL
56+
run: |
57+
if [[ "${{ github.repository }}" == "github/docs-internal" ]]; then
58+
echo "APP_URL=https://docs-review.github.com" >> $GITHUB_ENV
59+
elif [[ "${{ github.repository }}" == "github/docs" ]]; then
60+
echo "APP_URL=https://os-docs-review.github.com" >> $GITHUB_ENV
61+
fi
62+
5863
- name: Get changes table
5964
id: changes
6065
timeout-minutes: 30
6166
env:
6267
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
REVIEW_SERVER_ACCESS_TOKEN: ${{ secrets.REVIEW_SERVER_ACCESS_TOKEN }}
6369
APP_URL: ${{ env.APP_URL }}
6470
BASE_SHA: ${{ github.event.pull_request.base.sha || inputs.BASE_SHA }}
6571
HEAD_SHA: ${{ github.event.pull_request.head.sha || inputs.HEAD_SHA }}
72+
# HEAD_BRANCH isn't necessary for the table comment, but lets us list the branch in the review server menu bar
73+
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
6674
run: npm run content-changes-table-comment
6775

6876
- name: Find content directory changes comment
@@ -81,10 +89,10 @@ jobs:
8189
issue-number: ${{ github.event.pull_request.number || inputs.PR_NUMBER }}
8290
body: |
8391
<!-- MODIFIED_CONTENT_LINKING_COMMENT -->
84-
## Automatically generated comment ℹ️
85-
**This comment is automatically generated and will be overwritten every time changes are committed to this branch.**
92+
## 👓 Previews for changed content
93+
**This comment is 🤖 automatically generated and will be overwritten every time changes are committed to this branch.**
8694
87-
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.
95+
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.
8896
8997
---
9098
@@ -93,7 +101,6 @@ jobs:
93101
${{ steps.changes.outputs.changesTable }}
94102
95103
---
96-
fpt: Free, Pro, Team
97-
ghec: GitHub Enterprise Cloud
98-
ghes: GitHub Enterprise Server
104+
Key: **fpt**: Free, Pro, Team; **ghec**: GitHub Enterprise Cloud; **ghes**: GitHub Enterprise Server
105+
_This table is posted from the [${{ github.workflow }}](https://github.com/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/content-changes-table-comment.yml) workflow._
99106
edit-mode: replace

content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: About searching on GitHub
3-
intro: 'Our integrated search covers the many repositories, users, and lines of code on {% data variables.product.product_name %}.'
3+
intro: 'Our integrated search covers the many repositories, users, and lines of code on {% data variables.product.github %}.'
44
redirect_from:
55
- /articles/using-the-command-bar
66
- /articles/github-search-basics
@@ -22,7 +22,7 @@ topics:
2222

2323
{% data reusables.search.you-can-search-globally %}
2424

25-
* 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 %}.
25+
* 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 %}.
2626
* 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**.
2727

2828
{% 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
3636

3737
> [!NOTE]
3838
> * {% data reusables.search.required_login %}
39-
> * {% 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)
39+
> * {% 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)
4040
> * Currently our search doesn't support exact matching.{% ifversion ghes %}
4141
> * Whenever you are searching in code files, only the first two results in each file will be returned.{% endif %}
4242
43-
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).
43+
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).
4444

45-
{% 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.
45+
{% 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.
4646

4747
## Types of searches on {% data variables.product.prodname_dotcom %}
4848

@@ -60,29 +60,23 @@ You can search for the following information across all repositories you can acc
6060

6161
## Searching using a visual interface
6262

63-
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 %}
63+
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 %}
6464

6565
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.
6666

6767
![Advanced Search page. Top search bar holds "kittens user:octocat" query. Under "Advanced options", "From these owners" text box holds term "octocat".](/assets/images/help/search/advanced-search.png)
6868

6969
## Searching repositories on {% data variables.product.prodname_dotcom_the_website %} from your private enterprise environment
7070

71-
{% ifversion fpt or ghec %}
71+
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).
7272

73-
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.
73+
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 %}.
7474

75-
{% else %}
75+
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).
7676

77-
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).
77+
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 %}.
7878

79-
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 %}.
80-
81-
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).
82-
83-
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 %}.
84-
85-
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`.
79+
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`.
8680
{% endif %}
8781

8882
## Further reading

content/search-github/getting-started-with-searching-on-github/enabling-repository-search-across-environments.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ You can search for designated private repositories on {% data variables.product.
2020

2121
## Prerequisites
2222

23-
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).
23+
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).
2424

25-
## Enabling unified repository search from {% data variables.product.product_name %}
25+
## Enabling unified repository search from {% data variables.product.prodname_ghe_server %}
2626

27-
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 %}).
28-
1. On {% data variables.product.product_name %}, in the upper-right corner of any page, click your profile photo, then click **Settings**.
27+
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 %}).
28+
1. On {% data variables.product.prodname_ghe_server %}, in the upper-right corner of any page, click your profile photo, then click **Settings**.
2929

3030
{% ifversion global-nav-update %}
3131

0 commit comments

Comments
 (0)