Skip to content

Commit 626164f

Browse files
authored
Merge branch 'main' into patch-2
2 parents aa4ccda + 177f374 commit 626164f

430 files changed

Lines changed: 7666 additions & 6965 deletions

File tree

Some content is hidden

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

.github/actions-scripts/purge-fastly-edge-cache.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@
22

33
import purgeEdgeCache from '../../script/deployment/purge-edge-cache.js'
44

5-
try {
6-
await purgeEdgeCache()
7-
} catch (error) {
8-
console.error(`Failed to purge the edge cache: ${error.message}`)
9-
console.error(error)
10-
throw error
11-
}
5+
await purgeEdgeCache()

.github/actions-scripts/update-merge-queue-branch.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ const github = getOctokit(token)
88
// https://docs.github.com/en/graphql/reference/enums#mergestatestatus
99
// https://docs.github.com/en/graphql/reference/enums#mergeablestate
1010

11-
/*
12-
This script gets a list of automerge-enabled PRs and sorts them
11+
/*
12+
This script gets a list of automerge-enabled PRs and sorts them
1313
by priority. The PRs with the skip-to-front-of-merge-queue label
14-
are prioritized first. The rest of the PRs are sorted by the date
15-
they were updated. This is basically a FIFO queue, while allowing
14+
are prioritized first. The rest of the PRs are sorted by the date
15+
they were updated. This is basically a FIFO queue, while allowing
1616
writers the ability to skip the line when high-priority ships are
1717
needed but a freeze isn't necessary.
1818
*/
1919

20+
const DRY_RUN = Boolean(JSON.parse(process.env.DRY_RUN || 'false'))
21+
2022
main()
2123

2224
async function main() {
@@ -47,6 +49,15 @@ async function main() {
4749
name
4850
}
4951
}
52+
commits(last: 1) {
53+
nodes {
54+
commit {
55+
statusCheckRollup {
56+
state
57+
}
58+
}
59+
}
60+
}
5061
}
5162
}
5263
pageInfo {
@@ -105,6 +116,14 @@ async function main() {
105116
// a PR is green and the automerge is enabled
106117
.filter((pr) => pr.mergeStateStatus !== 'DIRTY')
107118
.filter((pr) => pr.mergeStateStatus !== 'UNSTABLE')
119+
.filter((pr) => {
120+
const nodes = pr.commits.nodes
121+
if (!nodes || !nodes.length) {
122+
// If it has no commits, why is it even here? Anyway, skip it.
123+
return false
124+
}
125+
return nodes[0].commit.statusCheckRollup.state !== 'FAILURE'
126+
})
108127

109128
autoMergeEnabledPRs.push(...filteredPrs)
110129
}
@@ -120,11 +139,15 @@ async function main() {
120139
if (prioritizedPrList.length) {
121140
const nextInQueue = prioritizedPrList.shift()
122141
// Update the branch for the next PR in the merge queue
123-
github.rest.pulls.updateBranch({
124-
owner: org,
125-
repo,
126-
pull_number: nextInQueue.number,
127-
})
142+
if (DRY_RUN) {
143+
console.log('DRY RUN! But *would* update on next-in-queue')
144+
} else {
145+
github.rest.pulls.updateBranch({
146+
owner: org,
147+
repo,
148+
pull_number: nextInQueue.number,
149+
})
150+
}
128151
console.log(`⏱ Total PRs in the merge queue: ${prioritizedPrList.length + 1}`)
129152
console.log(`🚂 Updated branch for PR #${JSON.stringify(nextInQueue, null, 2)}`)
130153
}

.github/workflows/browser-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,17 @@ jobs:
4949
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
5050
run: npm ci --include=optional
5151

52+
- name: Cache nextjs build
53+
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353
54+
with:
55+
path: .next/cache
56+
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}-${{ hashFiles('.github/workflows/browser-test.yml') }}
57+
58+
- name: Cache lib/redirects/.redirects-cache_en_ja.json
59+
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353
60+
with:
61+
path: lib/redirects/.redirects-cache_en_ja.json
62+
key: ${{ runner.os }}-redirects-cache-${{ hashFiles('.github/workflows/browser-test.yml') }}
63+
5264
- name: Run browser-test
5365
run: npm run browser-test

.github/workflows/create-translation-batch-pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,14 @@ jobs:
6767
wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O /tmp/crowdin.deb
6868
sudo dpkg -i /tmp/crowdin.deb
6969
70+
# Delete empty source files that would be rejected by Crowdin breaking the workflow
71+
- name: Remove empty source files
72+
run: |
73+
find content -type f -empty -delete
74+
find data -type f -empty -delete
75+
7076
- name: Upload files to crowdin
71-
run: crowdin upload sources --no-progress --no-colors --verbose --debug '--branch=main' '--config=crowdin.yml'
77+
run: crowdin upload sources --delete-obsolete --no-progress --no-colors --verbose --debug '--branch=main' '--config=crowdin.yml'
7278
env:
7379
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
7480
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api

.github/workflows/prod-build-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
env:
179179
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
180180
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
181-
FASTLY_SURROGATE_KEY: 'all-the-things'
181+
FASTLY_SURROGATE_KEY: 'every-deployment'
182182
run: .github/actions-scripts/purge-fastly-edge-cache.js
183183

184184
- name: Send Slack notification if workflow failed

components/hooks/useQuery.ts

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,33 @@ export const useQuery = (): QueryInfo => {
1111
? router.query.query[0]
1212
: router.query.query || ''
1313

14-
let debug = false
15-
if (router.query.debug) {
16-
// Now `router.query.debug` is either string or any array of strings
17-
debug = Boolean(
18-
JSON.parse(Array.isArray(router.query.debug) ? router.query.debug[0] : router.query.debug)
19-
)
20-
} else if (router.query.debug === '') {
21-
// E.g. `?query=foo&debug` should be treated as truthy
22-
debug = true
23-
}
14+
const debug = parseDebug(router.query.debug)
2415

2516
return {
2617
query,
2718
debug,
2819
}
2920
}
21+
22+
function parseDebug(debug: string | Array<string> | undefined) {
23+
if (debug === '') {
24+
// E.g. `?query=foo&debug` should be treated as truthy
25+
return true
26+
}
27+
28+
if (!debug) {
29+
return false
30+
}
31+
32+
// Now `router.query.debug` is either string or any array of strings
33+
if (Array.isArray(debug)) {
34+
debug = debug[0]
35+
}
36+
37+
try {
38+
debug = JSON.parse(debug)
39+
return Boolean(debug)
40+
} catch (e) {}
41+
42+
return false
43+
}

components/landing/ArticleList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const ArticleList = ({ title, viewAllHref, articles }: ArticleListPropsT)
7070
{link.date && (
7171
<time
7272
className="tooltipped tooltipped-n color-fg-muted text-mono mt-1"
73-
aria-label={dayjs(link.date).format('LLL')}
73+
aria-label={dayjs(link.date).format('MMMM DD')}
7474
>
7575
{dayjs(link.date).format('MMMM DD')}
7676
</time>

components/landing/CodeExampleCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const CodeExampleCard = ({ example }: Props) => {
3030
</div>
3131
</div>
3232
<footer className="border-top p-4 color-fg-muted d-flex flex-items-center">
33-
<RepoIcon className="flex-shrink-0" />
33+
<RepoIcon aria-label="repository URL" className="flex-shrink-0" />
3434
<TruncateLines
3535
as="span"
3636
maxLines={1}

components/sidebar/AllProductsLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ArrowLeftIcon } from '@primer/octicons-react'
44
export const AllProductsLink = () => {
55
const router = useRouter()
66
return (
7-
<li title="Home">
7+
<li>
88
<a href={`/${router.locale}`} className="f6 pl-4 pr-5 ml-n1 pb-1 color-fg-default">
99
<ArrowLeftIcon size="small" className="mr-1" />
1010
All products

content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ To keep your subscriptions manageable, review your subscriptions and watched rep
6363
To customize how you'd like to receive updates for specific pull requests or issues, you can configure your preferences within the issue or pull request. For more information, see "[Triaging a single notification](/github/managing-subscriptions-and-notifications-on-github/triaging-a-single-notification#customizing-when-to-receive-future-updates-for-an-issue-or-pull-request)."
6464

6565
{% ifversion fpt or ghes or ghec %}
66-
You can customize and schedule push notifications in the {% data variables.product.prodname_mobile %} app. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#managing-your-notification-settings-with-github-for-mobile)."
66+
You can customize and schedule push notifications in the {% data variables.product.prodname_mobile %} app. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#managing-your-notification-settings-with-github-mobile)."
6767
{% endif %}
6868

6969
## Reasons for receiving notifications

0 commit comments

Comments
 (0)