Skip to content

Commit 4ac5bae

Browse files
authored
Merge branch 'main' into docs-correct-sprint-word
2 parents 327190b + a06da21 commit 4ac5bae

File tree

425 files changed

+12784
-5440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

425 files changed

+12784
-5440
lines changed

.github/workflows/dry-run-elasticsearch-indexing.yml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
merge_group:
99
pull_request:
1010
paths:
11-
- script/search/index-elasticsearch.js
11+
- 'script/search/**'
1212
- 'package*.json'
1313
- .github/workflows/dry-run-elasticsearch-indexing.yml
1414

@@ -46,9 +46,57 @@ jobs:
4646
node-version: 16.15.x
4747
cache: npm
4848

49-
- name: Install
49+
- name: Install dependencies
5050
run: npm ci
5151

52+
- name: Cache nextjs build
53+
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
54+
with:
55+
path: .next/cache
56+
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}
57+
58+
- name: Run build scripts
59+
run: npm run build
60+
61+
- name: Start the server in the background
62+
env:
63+
ENABLE_DEV_LOGGING: false
64+
run: |
65+
npm run sync-search-server > /tmp/stdout.log 2> /tmp/stderr.log &
66+
67+
# first sleep to give it a chance to start
68+
sleep 6
69+
curl --retry-connrefused --retry 4 -I http://localhost:4002/
70+
71+
- if: ${{ failure() }}
72+
name: Debug server outputs on errors
73+
run: |
74+
echo "____STDOUT____"
75+
cat /tmp/stdout.log
76+
echo "____STDERR____"
77+
cat /tmp/stderr.log
78+
79+
- name: Scrape records into a temp directory
80+
env:
81+
# If a reusable, or anything in the `data/*` directory is deleted
82+
# you might get a
83+
#
84+
# RenderError: Can't find the key 'site.data.reusables...' in the scope
85+
#
86+
# But that'll get fixed in the next translation pipeline. For now,
87+
# let's just accept an empty string instead.
88+
THROW_ON_EMPTY: false
89+
90+
run: |
91+
mkdir /tmp/records
92+
npm run sync-search-indices -- \
93+
--language en \
94+
--version dotcom \
95+
--out-directory /tmp/records \
96+
--no-compression --no-lunr-index
97+
98+
ls -lh /tmp/records
99+
52100
# Serves two purposes;
53101
# 1. Be confident that the Elasticsearch server start-up worked at all
54102
# 2. Sometimes Elasticsearch will bind to the port but still not
@@ -62,8 +110,8 @@ jobs:
62110
ELASTICSEARCH_URL: 'http://localhost:9200'
63111
run: |
64112
./script/search/index-elasticsearch.js --verbose \
65-
-l en -l ja \
66-
-V dotcom -V ghes-3.5
113+
-l en \
114+
-V dotcom -- /tmp/records
67115
68116
- name: Show created indexes and aliases
69117
run: |

.github/workflows/sync-search-elasticsearch.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ jobs:
104104
- name: Index into Elasticsearch
105105
run: |
106106
./script/search/index-elasticsearch.js \
107-
--language ${{ matrix.language }} \
108-
--source-directory /tmp/records
107+
--language ${{ matrix.language }} -- /tmp/records
109108
110109
- name: Check created indexes and aliases
111110
run: |
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

components/Search.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,23 @@ function ShowSearchResults({
463463
</p>
464464

465465
<ActionList variant="full">
466-
{results.map(({ url, breadcrumbs, title, content, score, popularity }) => {
466+
{results.map(({ url, breadcrumbs, title, content, score, popularity }, index) => {
467467
return (
468468
<ActionList.Item className="width-full" key={url}>
469-
<Link href={url} className="no-underline color-fg-default">
469+
<Link
470+
href={url}
471+
className="no-underline color-fg-default"
472+
onClick={() => {
473+
sendEvent({
474+
type: EventType.searchResult,
475+
search_result_query: Array.isArray(query) ? query[0] : query,
476+
search_result_index: index,
477+
search_result_total: results.length,
478+
search_result_rank: (results.length - index) / results.length,
479+
search_result_url: url,
480+
})
481+
}}
482+
>
470483
<div
471484
data-testid="search-result"
472485
className={cx('list-style-none', styles.resultsContainer)}

components/guides/ArticleCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { ArticleGuide } from 'components/context/ProductGuidesContext'
21
import { Label } from '@primer/react'
32

3+
import { ArticleGuide } from 'components/context/ProductGuidesContext'
4+
import { Link } from 'components/Link'
5+
46
type Props = {
57
card: ArticleGuide
68
typeLabel: string
@@ -14,7 +16,7 @@ export const ArticleCard = ({ tabIndex, card, typeLabel }: Props) => {
1416
data-testid="article-card"
1517
className="d-flex col-12 col-md-4 pr-0 pr-md-6 pr-lg-8"
1618
>
17-
<a className="no-underline d-flex flex-column py-3 border-bottom" href={card.href}>
19+
<Link className="no-underline d-flex flex-column py-3 border-bottom" href={card.href}>
1820
<h3 className="h4 color-fg-default mb-1" dangerouslySetInnerHTML={{ __html: card.title }} />
1921
<div className="h6 text-uppercase" data-testid="article-card-type">
2022
{typeLabel}
@@ -38,7 +40,7 @@ export const ArticleCard = ({ tabIndex, card, typeLabel }: Props) => {
3840
})}
3941
</ul>
4042
)}
41-
</a>
43+
</Link>
4244
</li>
4345
)
4446
}

components/guides/LearningTrack.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { FeaturedTrack } from 'components/context/ProductGuidesContext'
77
import { TruncateLines } from 'components/ui/TruncateLines'
88
import slugger from 'github-slugger'
99
import styles from './LearningTrack.module.scss'
10+
import { Link } from 'components/Link'
1011

1112
type Props = {
1213
track: FeaturedTrack
@@ -37,7 +38,7 @@ export const LearningTrack = ({ track }: Props) => {
3738
</TruncateLines>
3839
</div>
3940
</div>
40-
<a
41+
<Link
4142
{...{ 'aria-label': `${track?.title} - ${t('start_path')}` }}
4243
className="d-inline-flex btn no-wrap mt-3 mt-md-0 flex-items-center flex-justify-center"
4344
href={`${track?.guides && track?.guides[0].href}?learn=${
@@ -46,7 +47,7 @@ export const LearningTrack = ({ track }: Props) => {
4647
>
4748
<span>{t('start_path')}</span>
4849
<ArrowRightIcon size={20} className="ml-2" />
49-
</a>
50+
</Link>
5051
</div>
5152

5253
{track && track.guides && (
@@ -81,7 +82,7 @@ export const LearningTrack = ({ track }: Props) => {
8182
},
8283
}}
8384
>
84-
<a
85+
<Link
8586
className="rounded-0 pl-7 py-4 width-full d-block Box-row d-flex flex-items-center color-fg-default no-underline"
8687
href={`${guide.href}?learn=${track?.trackName}&learnProduct=${track?.trackProduct}`}
8788
>
@@ -92,7 +93,7 @@ export const LearningTrack = ({ track }: Props) => {
9293
<div className="color-fg-muted h6 text-uppercase flex-shrink-0">
9394
{t('guide_types')[guide.page?.type || '']}
9495
</div>
95-
</a>
96+
</Link>
9697
</ActionList.Item>
9798
)
9899
})}

components/lib/get-rest-code-samples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function getShellExample(operation: Operation, codeSample: CodeSample) {
5050

5151
const args = [
5252
operation.verb !== 'get' && `-X ${operation.verb.toUpperCase()}`,
53-
`-H "Accept: ${defaultAcceptHeader}" \\ \n ${authHeader}`,
53+
`-H "Accept: ${defaultAcceptHeader}" \\\n ${authHeader}`,
5454
`${operation.serverUrl}${requestPath}`,
5555
requestBodyParams,
5656
].filter(Boolean)

components/parameter-table/ParameterTable.module.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.parameterTable {
2-
// this is for the child parameter table row that contiains the top level
2+
// this is for the child parameter table row that contains the top level
33
// properties details toggle element because we want it to match the
44
// background color of the top level parameter rows. We need the !important
55
// because the child parameter rows (the nested expanded properties) otherwise
@@ -17,4 +17,10 @@
1717
padding-left: 0px !important;
1818
margin-bottom: 4px !important;
1919
}
20+
21+
& > tbody > tr > td > * {
22+
width: auto;
23+
display: block;
24+
word-break: break-word;
25+
}
2026
}

components/search/SearchError.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function SearchError({ error }: Props) {
1919
{process.env.NODE_ENV === 'development' && <code>{error.toString()}</code>}
2020
</Flash>
2121
<Box>
22+
{/* This deliberately uses a <a> instead of <Link> so it triggers a full reload. */}
2223
<a href={`/${locale}${asPath}`}>Try reloading the page</a>
2324
</Box>
2425
</div>

components/search/SearchResults.tsx

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import type { SearchResultsT, SearchResultHitT } from './types'
55
import { useTranslation } from 'components/hooks/useTranslation'
66
import { Link } from 'components/Link'
77
import { useQuery } from 'components/hooks/useQuery'
8+
import { sendEvent, EventType } from 'components/lib/events'
89

910
type Props = {
1011
results: SearchResultsT
12+
query: string
1113
}
12-
export function SearchResults({ results }: Props) {
14+
export function SearchResults({ results, query }: Props) {
1315
const { t } = useTranslation('search')
1416

1517
const pages = Math.ceil(results.meta.found.value / results.meta.size)
@@ -31,20 +33,27 @@ export function SearchResults({ results }: Props) {
3133
)}
3234
</p>
3335

34-
<SearchResultHits hits={results.hits} />
36+
<SearchResultHits hits={results.hits} query={query} />
3537

3638
{pages > 1 && <ResultsPagination page={page} totalPages={pages} />}
3739
</div>
3840
)
3941
}
4042

41-
function SearchResultHits({ hits }: { hits: SearchResultHitT[] }) {
43+
function SearchResultHits({ hits, query }: { hits: SearchResultHitT[]; query: string }) {
4244
const { debug } = useQuery()
4345
return (
4446
<div>
4547
{hits.length === 0 && <NoSearchResults />}
46-
{hits.map((hit) => (
47-
<SearchResultHit key={hit.id} hit={hit} debug={debug} />
48+
{hits.map((hit, index) => (
49+
<SearchResultHit
50+
key={hit.id}
51+
hit={hit}
52+
query={query}
53+
totalHits={hits.length}
54+
index={index}
55+
debug={debug}
56+
/>
4857
))}
4958
</div>
5059
)
@@ -61,7 +70,19 @@ function NoSearchResults() {
6170
)
6271
}
6372

64-
function SearchResultHit({ hit, debug }: { hit: SearchResultHitT; debug: boolean }) {
73+
function SearchResultHit({
74+
hit,
75+
query,
76+
totalHits,
77+
index,
78+
debug,
79+
}: {
80+
hit: SearchResultHitT
81+
query: string
82+
totalHits: number
83+
index: number
84+
debug: boolean
85+
}) {
6586
const title =
6687
hit.highlights.title && hit.highlights.title.length > 0 ? hit.highlights.title[0] : hit.title
6788

@@ -72,6 +93,16 @@ function SearchResultHit({ hit, debug }: { hit: SearchResultHitT; debug: boolean
7293
href={hit.url}
7394
className="color-fg-accent"
7495
dangerouslySetInnerHTML={{ __html: title }}
96+
onClick={() => {
97+
sendEvent({
98+
type: EventType.searchResult,
99+
search_result_query: Array.isArray(query) ? query[0] : query,
100+
search_result_index: index,
101+
search_result_total: totalHits,
102+
search_result_rank: (totalHits - index) / totalHits,
103+
search_result_url: hit.url,
104+
})
105+
}}
75106
></Link>
76107
</h2>
77108
<h3 className="text-normal f4 mb-2">{hit.breadcrumbs}</h3>

components/search/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function Search() {
9292
{error ? (
9393
<SearchError error={error} />
9494
) : results ? (
95-
<SearchResults results={results} />
95+
<SearchResults results={results} query={query} />
9696
) : hasQuery ? (
9797
<Loading />
9898
) : (

content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/changing-your-github-username.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ After changing your username, links to your previous profile page, such as `http
7373

7474
{% ifversion fpt or ghec %}Git commits that were associated with your {% data variables.product.product_name %}-provided `noreply` email address won't be attributed to your new username and won't appear in your contributions graph.{% endif %} If your Git commits are associated with another email address you've [added to your GitHub account](/articles/adding-an-email-address-to-your-github-account), {% ifversion fpt or ghec %}including the ID-based {% data variables.product.product_name %}-provided `noreply` email address, {% endif %}they'll continue to be attributed to you and appear in your contributions graph after you've changed your username. For more information on setting your email address, see "[Setting your commit email address](/articles/setting-your-commit-email-address)."
7575

76+
## Your gists
77+
78+
After changing your username, the URLs to any public or secret gists will also change and previous links to these will return a 404 error. We recommend updating the links to these gists anywhere you may have shared them.
79+
7680
## Changing your username
7781

7882
{% data reusables.user-settings.access_settings %}

content/actions/hosting-your-own-runners/about-self-hosted-runners.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ The following operating systems are supported for the self-hosted runner applica
123123
The following processor architectures are supported for the self-hosted runner application.
124124

125125
- `x64` - Linux, macOS, Windows.
126-
- `ARM64` - Linux{% ifversion actions-macos-arm %}, macOS{% endif %}.
127-
- `ARM32` - Linux only.
126+
- `ARM64` - Linux{% ifversion actions-macos-arm %}, macOS{% endif %}{% ifversion actions-windows-arm %}, Windows (currently in beta){% endif %}.
127+
- `ARM32` - Linux.
128128

129129
{% ifversion ghes %}
130130

content/actions/learn-github-actions/contexts.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ The following table indicates where each context and special function can be use
7474

7575
| Workflow key | Context | Special functions |
7676
| ---- | ------- | ----------------- |
77+
{%- ifversion actions-run-name %}
78+
| <code>run-name</code> | <code>github, inputs</code> | |
79+
{%- endif %}
7780
| <code>concurrency</code> | <code>github, inputs</code> | |
7881
| <code>env</code> | <code>github, secrets, inputs</code> | |
7982
| <code>jobs.&lt;job_id&gt;.concurrency</code> | <code>github, needs, strategy, matrix, inputs</code> | |
@@ -211,6 +214,9 @@ The `github` context contains information about the workflow run and the event t
211214
{%- ifversion fpt or ghec or ghes > 3.5 or ghae > 3.4 %}
212215
| `github.run_attempt` | `string` | A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. |
213216
{%- endif %}
217+
{%- ifversion fpt or ghec or ghes > 3.3 or ghae > 3.3 %}
218+
| `github.secret_source` | `string` | The source of a secret used in a workflow. Possible values are `None`, `Actions`, `Dependabot`, or `Codespaces`. |
219+
{%- endif %}
214220
| `github.server_url` | `string` | The URL of the GitHub server. For example: `https://github.com`. |
215221
| `github.sha` | `string` | {% data reusables.actions.github_sha_description %} |
216222
| `github.token` | `string` | A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the `GITHUB_TOKEN` secret. For more information, see "[Automatic token authentication](/actions/security-guides/automatic-token-authentication)." <br /> Note: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`. |{% ifversion actions-stable-actor-ids %}

0 commit comments

Comments
 (0)