Skip to content

Commit b976e25

Browse files
authored
Merge pull request #46206 from github/repo-sync
Repo sync
2 parents a82be44 + 6e2bc60 commit b976e25

67 files changed

Lines changed: 442 additions & 889 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.

‎.devcontainer/Dockerfile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# To find available Node images, see https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
1+
# Update ARG and FROM together from the Node devcontainer image tags:
2+
# https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
23
ARG VARIANT=dev-24-bookworm
3-
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:c6c609fc8c4e9418991aae295debc1f4f94f000f4cc7ca5531446f1ea8258056
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:c39e4aaf0c7c4da594f845aeb98d37510343bff178b320a6f7e9e2e95ca7957e

‎.github/CODEOWNERS‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# Order is important. The LAST matching pattern has the MOST precedence.
2-
# gitignore style patterns are used, not globs.
3-
# https://docs.github.com/articles/about-codeowners
4-
# https://git-scm.com/docs/gitignore
1+
# Last matching pattern wins.
2+
# Patterns use gitignore syntax, not glob syntax.
53

6-
# Site Policy
74
content/site-policy/ @github/site-policy-admins
8-
9-
# Requires review of #actions-oidc-integration, docs-engineering/issues/1506
10-
# content/actions/deployment/security-hardening-your-deployments/** @github/oidc

‎.github/actions/cache-nextjs/action.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Based on https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
1+
# Based on Next.js CI build cache guidance:
2+
# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
23

34
name: Cache Nextjs build cache
45

@@ -11,8 +12,8 @@ runs:
1112
uses: actions/cache@v4
1213
with:
1314
path: ${{ github.workspace }}/.next/cache
14-
# Generate a new cache whenever packages or source files change.
15+
# Packages and source files both invalidate the cache.
1516
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
16-
# If source files changed but packages didn't, rebuild from a prior cache.
17+
# With matching restore-key prefixes, source-only changes restore the same-package cache.
1718
restore-keys: |
1819
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

‎.github/actions/create-workflow-failure-issue/action.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ runs:
104104
--body "$body")
105105
echo "issue_url=$url" >> "$GITHUB_OUTPUT"
106106
107-
# Set the type separately, and tolerate failure. This action is itself the
108-
# failure path, so losing the whole issue because issue types are unavailable
109-
# or `gh` is too old (--type needs gh 2.94+) would hide the original failure.
107+
# Set type separately with gh 2.94+ --type; keep the issue visible if gh or issue types lack support.
110108
gh issue edit "$url" --type Bug \
111109
|| echo "Warning: could not set issue type on $url; leaving it unset."

‎.github/actions/labeler/labeler.ts‎

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* See function main in this file for documentation */
2-
31
import * as coreLib from '@actions/core'
42
import { type Octokit } from '@octokit/rest'
53
import { CoreInject } from '@/links/scripts/action-injections'
@@ -18,7 +16,7 @@ type Options = {
1816
repo?: string
1917
}
2018

21-
// When this file is invoked directly from action as opposed to being imported
19+
// Run action wiring only for direct execution, not imports from tests or other code.
2220
if (import.meta.url.endsWith(process.argv[1])) {
2321
if (!process.env.GITHUB_TOKEN) {
2422
throw new Error('You must set the GITHUB_TOKEN environment variable.')
@@ -33,7 +31,7 @@ if (import.meta.url.endsWith(process.argv[1])) {
3331
ignoreIfLabeled: boolEnvVar('IGNORE_IF_LABELED'),
3432
}
3533

36-
// labels come in comma separated from actions
34+
// Actions pass comma-separated labels.
3735
if (typeof ADD_LABELS === 'string') {
3836
opts.addLabels = [...ADD_LABELS.split(',')].map((l) => l.trim())
3937
} else {
@@ -60,18 +58,6 @@ if (import.meta.url.endsWith(process.argv[1])) {
6058
main(coreLib, octokit, opts)
6159
}
6260

63-
/*
64-
* Applies labels to an issue or pull request.
65-
*
66-
* opts:
67-
* issue_number {number} id of the issue or pull request to label
68-
* owner {string} owner of the repository
69-
* repo {string} repository name
70-
* addLabels {Array<string>} array of labels to apply
71-
* removeLabels {Array<string>} array of labels to remove
72-
* ignoreIfAssigned {boolean} don't apply labels if there are assignees
73-
* ignoreIfLabeled {boolean} don't apply labels if there are already labels added
74-
*/
7561
export default async function main(
7662
core: typeof coreLib | CoreInject,
7763
octokit: Octokit,
@@ -118,7 +104,7 @@ export default async function main(
118104
}
119105

120106
if (opts.removeLabels?.length) {
121-
// removing a label fails if the label isn't already applied
107+
// Remove only applied labels because the API rejects missing labels.
122108
let appliedLabels = []
123109

124110
try {

‎.github/actions/node-npm-setup/action.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ runs:
99
uses: actions/cache@v4
1010
id: cache-node_modules
1111
env:
12-
# Default is 10 min, per segment, but we can make it much smaller
13-
# because it's not the end of the world if the cache restore fails.
12+
# Cache restore failures are acceptable, so keep the segment timeout short.
1413
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '1'
1514
with:
1615
path: node_modules

‎.github/actions/precompute-pageinfo/action.yml‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎.github/actions/retry-command/action.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ runs:
2323
INPUT_DELAY: ${{ inputs.delay }}
2424
INPUT_COMMAND: ${{ inputs.command }}
2525
run: |
26-
# Generic retry function: configurable attempts and delay
2726
retry_command() {
2827
local max_attempts=${INPUT_MAX_ATTEMPTS}
2928
local delay=${INPUT_DELAY}

‎.github/actions/setup-elasticsearch/action.yml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# For the sake of saving time, only run this step if the test-group is one that will run tests against an Elasticsearch on localhost.
1+
# Callers skip this action for test groups that do not use local Elasticsearch.
22
name: Set up local Elasticsearch
33

44
description: Install a local Elasticsearch with version that matches prod
@@ -10,13 +10,13 @@ inputs:
1010
elasticsearch_version:
1111
description: Version of Elasticsearch to install
1212
required: true
13-
# Make sure the version matches production and is available on Docker Hub
13+
# Version must match production and be published on Docker Hub.
1414
default: '8.12.0'
1515

1616
runs:
1717
using: 'composite'
1818
steps:
19-
# Cache the elasticsearch image to prevent Docker Hub rate limiting
19+
# Cache the Elasticsearch image to prevent Docker Hub rate limits.
2020
- name: Cache Docker layers
2121
id: cache-docker-layers
2222
uses: actions/cache@v4
@@ -47,8 +47,7 @@ runs:
4747
mkdir -p /tmp/docker-cache
4848
docker save -o /tmp/docker-cache/elasticsearch.tar elasticsearch:${ES_VERSION}
4949
50-
# Setups the Elasticsearch container
51-
# Derived from https://github.com/getong/elasticsearch-action
50+
# Run a single-node container with settings copied from getong/elasticsearch-action.
5251
- name: Run Docker container
5352
shell: bash
5453
env:
@@ -80,7 +79,6 @@ runs:
8079
-e discovery_type=$INPUT_DISCOVERY_TYPE \
8180
elasticsearch:$INPUT_ELASTICSEARCH_VERSION
8281
83-
# Check if Elasticsearch is up and running
8482
for i in {1..120}; do
8583
if curl --silent --fail http://localhost:9200; then
8684
echo "Elasticsearch is up and running"

‎.github/actions/slack-alert/action.yml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ inputs:
2727
runs:
2828
using: composite
2929
steps:
30-
# Build the Slack text here so the default message can be multi-line (real
31-
# newlines) and conditionally include the issue link. A caller-supplied
32-
# message is passed through verbatim for backward compatibility.
30+
# Build default Slack text in shell so it can include real newlines and an issue link.
31+
# Caller-supplied messages pass through unchanged for backward compatibility.
3332
- name: Build Slack message
3433
id: build
3534
shell: bash
@@ -43,10 +42,9 @@ runs:
4342
GIT_REF: ${{ github.ref }}
4443
ACTOR: ${{ github.actor }}
4544
run: |
46-
# Escape Slack mrkdwn control chars in interpolated context fields so a
47-
# crafted branch/ref (e.g. containing <!channel>) can't inject mentions.
45+
# Escape generated fields so branch/ref text like <!channel> cannot inject Slack mentions.
4846
esc() { printf '%s' "$1" | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g'; }
49-
# Unique heredoc delimiter so a custom message can't collide with it.
47+
# Pick a unique heredoc delimiter so custom messages cannot collide with it.
5048
delim="SLACK_EOF_${RANDOM}${RANDOM}"
5149
{
5250
printf 'text<<%s\n' "$delim"

0 commit comments

Comments
 (0)