Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
ALGOLIA_API_KEY=
ALGOLIA_APPLICATION_ID=
ALLOW_TRANSLATION_COMMITS=
4 changes: 4 additions & 0 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
# Even if if doesn't do anything
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout

- name: Setup Node
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/dry-run-sync-search-indices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ jobs:
run: npm run build
- name: (Dry run) sync indices
env:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-search-dry-run
2 changes: 2 additions & 0 deletions .github/workflows/openapi-schema-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
branches:
- main
pull_request:
paths:
- 'lib/rest/static/**'

jobs:
check-schema-versions:
Expand Down
77 changes: 67 additions & 10 deletions .github/workflows/sync-search-indices.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,95 @@
name: Sync search indexes

# **What it does**: This updates our search indexes after each deployment.
# **What it does**: This workflow syncs the Lunr search indexes.
# The search indexes are checked into the lib/search/indexes directory.
# Search indexes are checked directly into the `main` branch on both the
# internal and open-source docs repositories. This workflow should be the
# only mechanism that the search indexes are modified. Because of that,
# repo-sync will not sync the search indexes because it should not detect
# a change.
# **Why we have it**: We want our search indexes kept up to date.
# **Who does it impact**: Anyone using search on docs.

# **Testing: To test this workflow, use the workflow_dispatch event and trigger
# the workflow from the action tab. Select the branch with the changes to the
# workflow. Set `fetch-depth: 0` as an input to the checkout action to get all
# branches, including your test branch. Otherwise, you'll only get the main
# branch. For git lfs push and git push commands use the --dry-run switch to
# prevent pushes (e.g., git push --dry-run origin main --no-verify and
# git lfs push --dry-run public-docs-repo).
# The dry-run switch does everything but actually send the updates.

on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '53 0/4 * * *' # Run every four hours at 53 minutes past the hour

jobs:
updateIndices:
name: Update indices
updateIndexes:
name: Update indexes
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
# Check out internal docs repository
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
token: ${{ secrets.DOCS_BOT }}

- name: Setup Node
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
cache: npm

- name: Install dependencies
run: npm ci

- name: Run build scripts
run: npm run build
- name: sync indices

- name: Update search indexes
env:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-search
# TODO remove version and language after first successful run to test
run: VERSION=github-ae@latest LANGUAGE=pt npm run sync-search

- name: Update private docs repository search indexes
# Git pre-push hooks push the LFS objects, so if you don't run them and
# don't push the LFS objects manually, the LFS objects won't get
# pushed. That will likely result in the push getting rejected.
# So if you don't use the pre-push hooks or you run with --no-verify
# the LFS objects need to be pushed first.
run: |
echo 'git checkout main'
git checkout main
echo 'git config user.name "GitHub Actions"'
git config user.name "GitHub Actions"
echo 'git config user.email action@github.com'
git config user.email action@github.com
echo 'git commit -am "update search indexes"'
git commit -am "update search indexes"
echo 'git lfs push origin'
git lfs push origin
echo 'git push origin main --no-verify'
git push origin main --no-verify
- name: Update open-source docs repository search indexes
# Git pre-push hooks push the LFS objects, so if you don't run them and
# don't push the LFS objects manually, the LFS objects won't get
# pushed. That will likely result in the push getting rejected.
# So if you don't use the pre-push hooks or you run with --no-verify
# the LFS objects need to be pushed first.
run: |
echo 'git remote add public-docs-repo https://github.com/github/docs.git'
git remote add public-docs-repo https://github.com/github/docs.git
echo 'git lfs push public-docs-repo'
git lfs push public-docs-repo
echo 'git pull public-docs-repo main'
git pull public-docs-repo main
echo 'git push public-docs-repo main --no-verify'
git push public-docs-repo main --no-verify
- name: Send slack notification if workflow run fails
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure()
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-single-english-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Sync Single English Index
# **Who does it impact**:

on:
workflow_dispatch:
pull_request:
types:
- labeled
Expand Down Expand Up @@ -39,9 +40,15 @@ jobs:
env:
VERSION: ${{ steps.getVersion.outputs.versionToSync }}
LANGUAGE: 'en'
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run build
npm run sync-search
- name: Check in search index
uses: EndBug/add-and-commit@2bdc0a61a03738a1d1bda24d566ad0dbe3083d87
with:
# The arguments for the `git add` command
add: 'lib/search/indexes'

# The message for the commit
message: 'Updated search index for ${{ steps.getVersion.outputs.versionToSync }}'
3 changes: 3 additions & 0 deletions .github/workflows/triage-unallowed-contributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- 'lib/redirects/**'
- 'lib/rest/**'
- 'lib/webhooks/**'
- 'lib/search/indexes/**'
- 'scripts/**'
- 'translations/**'
- 'package*.json'
Expand Down Expand Up @@ -76,6 +77,7 @@ jobs:
- 'lib/redirects/**'
- 'lib/rest/**'
- 'lib/webhooks/**'
- 'lib/search/indexes/**'
- 'scripts/**'
- 'translations/**'
- 'package*.json'
Expand All @@ -101,6 +103,7 @@ jobs:
'lib/redirects/**',
'lib/rest/**',
'lib/webhooks/**',
'lib/search/indexes/**'
'scripts/**',
'translations/**',
'package*.json',
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.algolia-cache
.search-cache
.DS_Store
.env
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/profile/org_profile_verified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function Search({ isStandalone = false, updateSearchParams = true, childr

// If the user shows up with a query in the URL, go ahead and search for it
useEffect(() => {
if (router.query.query) {
if (updateSearchParams && router.query.query) {
/* await */ fetchSearchResults((router.query.query as string).trim())
}
}, [])
Expand Down
4 changes: 2 additions & 2 deletions components/page-header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Header = () => {
{/* <!-- GitHub.com homepage and 404 page has a stylized search; Enterprise homepages do not --> */}
{relativePath !== 'index.md' && error !== '404' && (
<div className="d-inline-block ml-4">
<Search />
{router.asPath !== '/graphql/overview/explorer' && <Search />}
</div>
)}
</div>
Expand Down Expand Up @@ -112,7 +112,7 @@ export const Header = () => {
{/* <!-- GitHub.com homepage and 404 page has a stylized search; Enterprise homepages do not --> */}
{relativePath !== 'index.md' && error !== '404' && (
<div className="pt-3 border-top">
<Search />
{router.asPath !== '/graphql/overview/explorer' && <Search />}
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ shortTitle: Organization's profile
---
You can optionally choose to add a description, location, website, and email address for your organization, and pin important repositories to the top of the page.

{% ifversion fpt %}To confirm your organization's identity and display a "Verified" badge on your organization profile page, you must verify your organization's domains with {% data variables.product.product_name %}. For more information, see "[Verifying or approving a domain for your organization](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)."
{% ifversion fpt %}To confirm your organization's identity and display a "Verified" badge on your organization profile page, you must verify your organization's domains with {% data variables.product.product_name %}. For more information, see "[Verifying or approving a domain for your organization](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)."{% endif %}

![Sample verified organization profile page](/assets/images/help/profile/org_profile_verified.png)
{% ifversion fpt or ghes > 3.2 %}
![Sample organization profile page](/assets/images/help/organizations/org_profile_with_overview.png)
{% else %}
![Sample organization profile page](/assets/images/help/profile/org_profile.png)
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Some of the features listed below are limited to organizations using {% data var
| Set scheduled reminders (see "[Managing scheduled reminders for pull requests](/github/setting-up-and-managing-organizations-and-teams/managing-scheduled-reminders-for-pull-requests)") | **X** | | |
| Add collaborators to **all repositories** | **X** | | |
| Access the organization audit log | **X** | | |
| Edit the organization's profile page (see "[About your organization's profile](/articles/about-your-organization-s-profile)" for details) | **X** | | |
| Edit the organization's profile page (see "[About your organization's profile](/github/setting-up-and-managing-your-github-profile/customizing-your-profile/about-your-organizations-profile)" for details) | **X** | | |
| Verify the organization's domains (see "[Verifying your organization's domain](/articles/verifying-your-organization-s-domain)" for details) | **X** | | |
| Restrict email notifications to verified or approved domains (see "[Restricting email notifications for your organization](/organizations/keeping-your-organization-secure/restricting-email-notifications-for-your-organization)" for details) | **X** | | |
| Delete **all teams** | **X** | | |
Expand Down Expand Up @@ -102,7 +102,7 @@ Some of the features listed below are limited to organizations using {% data var
| Configure code review assignments (see "[Managing code review assignment for your team](/organizations/organizing-members-into-teams/managing-code-review-assignment-for-your-team)") | **X** | |
| Add collaborators to **all repositories** | **X** | |
| Access the organization audit log | **X** | |
| Edit the organization's profile page (see "[About your organization's profile](/articles/about-your-organization-s-profile)" for details) | **X** | | |
| Edit the organization's profile page (see "[About your organization's profile](/github/setting-up-and-managing-your-github-profile/customizing-your-profile/about-your-organizations-profile)" for details) | **X** | | |
| Delete **all teams** | **X** | |
| Delete the organization account, including all repositories | **X** | |
| Create teams (see "[Setting team creation permissions in your organization](/articles/setting-team-creation-permissions-in-your-organization)" for details) | **X** | **X** |
Expand Down
16 changes: 9 additions & 7 deletions contributing/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ Using the attribute `topics` in your query will only return results that have th

## Production deploys

A [GitHub Actions workflow](.github/workflows/sync-search-indices.yml) triggered by pushes to the `main` branch syncs the search data. This process generates structured data for all pages on the site, compares that data to what's currently on search, then adds, updates, or removes indices based on the diff of the local and remote data, being careful not to create duplicate records and avoiding any unnecessary (and costly) indexing operations.
A [GitHub Actions workflow](.github/workflows/sync-search-indices.yml) that runs every four hours syncs the search data. This process generates structured data for all pages on the site, compares that data to what's currently on search, then adds, updates, or removes indices based on the diff of the local and remote data, being careful not to create duplicate records and avoiding any unnecessary (and costly) indexing operations.

The Actions workflow progress can be viewed (by GitHub employees) in the [Actions tab](https://github.com/github/docs/actions?query=workflow%3Asearch) of the repo.

Because the workflow runs after a branch is merged to `main`, there is a slight delay for search data updates to appear on the site.
## Manually triggering the search index update workflow

## Manual sync from a checkout
You can manually run the workflow to generate the indexes after you push your changes to `main` to speed up the indexing when needed. To run it manually, click "Run workflow" button in the [Actions tab](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml).

It is also possible to manually sync the indices from your local checkout of the repo, before your branch is merged to `main`.
## Generating search indexes for your local checkout

**Prerequisite:** Make sure the environment variables `ALGOLIA_APPLICATION_ID` and `ALGOLIA_API_KEY` are set in your `.env` file. You can find these values on [Algolia](https://www.algolia.com/apps/ZI5KPY1HBE/api-keys/all). _Remove this paragraph when we switch to Lunr._
You can locally generate search indexes, but please do not check them into your local branch because they can get out-of-sync with the `main` branch quickly.

To locally generate the English version of the Dotcom search index locally, run `LANGUAGE=en VERSION=free-pro-team@latest npm run sync-search`. See [Build and sync](#build-and-sync) below for more details. To revert those files run `git checkout lib/search/indexes`.

### Build without sync (dry run)

Expand Down Expand Up @@ -75,7 +77,7 @@ VERSION=<PLAN@RELEASE LANGUAGE=<TWO-LETTER CODE> npm run sync-search
```
You can set `VERSION` and `LANGUAGE` individually, too.

Substitute a currently supported version for `<PLAN@RELEASE>` and a currently supported two-letter language code for `<TWO-LETTER-CODE>`.
Substitute a currently supported version for `<PLAN@RELEASE>` and a currently supported two-letter language code for `<TWO-LETTER-CODE>`. Languages and versions are lowercase. The options for version are currently `free-pro-team`, `github-ae`, and `enterprise-server`.

## Label-triggered Actions workflow

Expand All @@ -95,7 +97,7 @@ Why do we need this? For our daily shipping needs, it's tolerable that search up

### Actions workflow files

- [`.github/workflows/sync-search-indices.yml`](.github/workflows/sync-search-indices.yml) - Builds and syncs search indices whenever the `main` branch is pushed to (that is, on production deploys).
- [`.github/workflows/sync-search-indices.yml`](.github/workflows/sync-search-indices.yml) - Builds and syncs search indices on the `main` branch every four hours. Search indices are committed directly to the `main` branch on both the `github/docs-internal` and `github/docs` repositories. It can also be run manually. To run it manually, click "Run workflow" button in the [Actions tab](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml).
- [`.github/workflows/dry-run-sync-search-indices.yml`](.github/workflows/dry-run-sync-search-indices.yml) - This workflow can be run manually (via `workflow_dispatch`) to do a dry run build of all the indices. Useful for confirming that the indices can build without erroring out.
- [`.github/workflows/sync-single-english-index.yml`](.github/workflows/sync-single-english-index.yml) - This workflow is run when a label in the right format is applied to a PR. See "[Label-triggered Actions workflow](#label-triggered-actions-workflow)" for details.

Expand Down
8 changes: 6 additions & 2 deletions data/reusables/organizations/new_team.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
1. Under your organization name, click {% octicon "people" aria-label="The people icon" %} **Teams**.
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% ifversion fpt or ghes > 3.2 %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab-with-overview.png)
{% else %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% endif %}
1. On the right side of the Teams tab, click **New team**.
![New team button](/assets/images/help/teams/new-team-button.png)
![New team button](/assets/images/help/teams/new-team-button.png)
6 changes: 5 additions & 1 deletion data/reusables/organizations/org_settings.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
1. Under your organization name, click {% octicon "gear" aria-label="The Settings gear" %} **Settings**.
![Organization settings button](/assets/images/help/organizations/organization-settings-tab.png)
{% ifversion fpt or ghes > 3.2 %}
![Organization settings button](/assets/images/help/organizations/organization-settings-tab-with-overview-tab.png)
{% else %}
![Organization settings button](/assets/images/help/organizations/organization-settings-tab.png)
{% endif %}
4 changes: 4 additions & 0 deletions data/reusables/organizations/organization-wide-project.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
1. Under your organization name, click {% octicon "project" aria-label="The Projects icon" %} **Projects**.
{% ifversion fpt or ghes > 3.2 %}
![Projects tab for your organization](/assets/images/help/organizations/organization-projects-tab-with-overview-tab.png)
{% else %}
![Projects tab for your organization](/assets/images/help/organizations/organization-projects-tab.png)
{% endif %}
8 changes: 6 additions & 2 deletions data/reusables/organizations/owners-team.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
1. Under your organization name, click {% octicon "people" aria-label="The people icon" %} **Teams**.
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% ifversion fpt or ghes > 3.2 %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab-with-overview.png)
{% else %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% endif %}
1. On the Teams tab, click **Owners**.
![Owners team selected](/assets/images/help/teams/owners-team.png)
![Owners team selected](/assets/images/help/teams/owners-team.png)
6 changes: 5 additions & 1 deletion data/reusables/organizations/people.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
1. Under your organization name, click {% octicon "organization" aria-label="The People icon" %} **People**.
![The People tab](/assets/images/help/organizations/organization-people-tab.png)
{% ifversion fpt or ghes > 3.2 %}
![The People tab](/assets/images/help/organizations/organization-people-tab-with-overview-tab.png)
{% else %}
![The People tab](/assets/images/help/organizations/organization-people-tab.png)
{% endif %}
8 changes: 6 additions & 2 deletions data/reusables/organizations/specific_team.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
1. Under your organization name, click {% octicon "people" aria-label="The people icon" %} **Teams**.
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% ifversion fpt or ghes > 3.2 %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab-with-overview.png)
{% else %}
![Teams tab](/assets/images/help/organizations/organization-teams-tab.png)
{% endif %}
1. On the Teams tab, click the name of the team.
![List of the organization's teams](/assets/images/help/teams/click-team-name.png)
![List of the organization's teams](/assets/images/help/teams/click-team-name.png)
Loading