Skip to content

Commit 1689a07

Browse files
authored
Merge branch 'main' into ruby-guide-patch
2 parents c954a53 + ee8fa47 commit 1689a07

File tree

1,227 files changed

+21596
-43476
lines changed

Some content is hidden

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

1,227 files changed

+21596
-43476
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
1414

1515
# [Optional] Uncomment if you want to install more global node modules
1616
# RUN su node -c "npm install -g <your-package-list-here>"
17+
18+
# Install the GitHub CLI see:
19+
# https://github.com/microsoft/vscode-dev-containers/blob/3d59f9fe37edb68f78874620f33dac5a62ef2b93/script-library/docs/github.md
20+
COPY library-scripts/github-debian.sh /tmp/library-scripts/
21+
RUN apt-get update && bash /tmp/library-scripts/github-debian.sh

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node
3+
// -
34
{
45
"name": "docs.github.com",
56
"build": {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/github.md
8+
#
9+
# Syntax: ./github-debian.sh [version]
10+
11+
CLI_VERSION=${1:-"latest"}
12+
13+
set -e
14+
15+
if [ "$(id -u)" -ne 0 ]; then
16+
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
17+
exit 1
18+
fi
19+
20+
export DEBIAN_FRONTEND=noninteractive
21+
22+
# Install curl, apt-transport-https or gpg if missing
23+
if ! dpkg -s curl ca-certificates > /dev/null 2>&1; then
24+
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
25+
apt-get update
26+
fi
27+
apt-get -y install --no-install-recommends curl ca-certificates
28+
fi
29+
30+
# Get latest release number if latest is specified
31+
if [ "${CLI_VERSION}" = "latest" ] || [ "${CLI_VERSION}" = "current" ] || [ "${CLI_VERSION}" = "lts" ]; then
32+
LATEST_RELEASE=$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/cli/cli/releases?per_page=1&page=1")
33+
CLI_VERSION=$(echo ${LATEST_RELEASE} | grep -oE 'tag_name":\s*"v[^"]+' | sed -n '/tag_name":\s*"v/s///p')
34+
fi
35+
36+
# Install the GitHub CLI
37+
echo "Downloading github CLI..."
38+
curl -OsSL https://github.com/cli/cli/releases/download/v${CLI_VERSION}/gh_${CLI_VERSION}_linux_amd64.deb
39+
echo "Installing github CLI..."
40+
apt-get install ./gh_${CLI_VERSION}_linux_amd64.deb
41+
echo "Removing github CLI deb file after installation..."
42+
rm -rf ./gh_${CLI_VERSION}_linux_amd64.deb
43+
echo "Done!"

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ tests/
1010
lib/rest/static/dereferenced
1111
# Folder is cloned during the preview + prod workflows, the assets are merged into other locations for use before the build
1212
docs-early-access/
13+
# During the preview deploy untrusted user code may be cloned into this directory
14+
user-code/

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/script/ @github/docs-engineering
1212
/includes/ @github/docs-engineering
1313
/lib/search/popular-pages.json @github/docs-engineering
14-
app.json @github/docs-engineering
1514
Dockerfile @github/docs-engineering
1615
package-lock.json @github/docs-engineering
1716
package.json @github/docs-engineering

.github/actions-scripts/content-changes-table-comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ for (const file of articleFiles) {
3636
const sourceUrl = file.blob_url
3737
const fileName = file.filename.slice(pathPrefix.length)
3838
const fileUrl = fileName.slice(0, fileName.lastIndexOf('.'))
39-
const previewLink = `https://${APP_URL}/${fileUrl}`
39+
const previewLink = `${APP_URL}/${fileUrl}`
4040
const productionLink = `https://docs.github.com/${fileUrl}`
4141
let markdownLine = ''
4242

.github/actions-scripts/get-preview-app-info.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,28 @@
1010
[[ -z $GITHUB_REPOSITORY ]] && { echo "Missing GITHUB_REPOSITORY. Exiting."; exit 1; }
1111
[[ -z $PR_NUMBER ]] && { echo "Missing PR_NUMBER. Exiting."; exit 1; }
1212
[[ -z $GITHUB_ENV ]] && { echo "Missing GITHUB_ENV. Exiting."; exit 1; }
13+
[[ -z $APP_NAME_SEED ]] && { echo "Missing APP_NAME_SEED. Exiting."; exit 1; }
1314

14-
# Number of resource groups that we use to split preview envs across
15-
PREVIEW_ENV_RESOURCE_GROUPS=4
15+
PREVIEW_ENV_LOCATION="eastus"
16+
echo "PREVIEW_ENV_LOCATION=${PREVIEW_ENV_LOCATION}" >> $GITHUB_ENV
1617

1718
REPO_NAME="${GITHUB_REPOSITORY#*\/}"
1819
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
1920

2021
DEPLOYMENT_NAME="${REPO_NAME}-pr-${PR_NUMBER}"
2122
echo "DEPLOYMENT_NAME=${DEPLOYMENT_NAME}" >> $GITHUB_ENV
2223

23-
RESOURCE_GROUP="preview-env-${REPO_NAME}-$((${PR_NUMBER} % ${PREVIEW_ENV_RESOURCE_GROUPS}))"
24-
echo "RESOURCE_GROUP=${RESOURCE_GROUP}" >> $GITHUB_ENV
24+
APP_NAME_BASE="${REPO_NAME}-preview-${PR_NUMBER}"
25+
echo "APP_NAME_BASE=${APP_NAME_BASE}" >> $GITHUB_ENV
2526

26-
APP_NAME_SHORT="${REPO_NAME}-preview-${PR_NUMBER}"
27-
echo "APP_NAME_SHORT=${APP_NAME_SHORT}" >> $GITHUB_ENV
27+
# pseudo random string so guessing a preview env URL is more difficult
28+
APP_SHA=$(echo -n "${APP_NAME_SEED}-${APP_NAME_BASE}" | sha1sum | cut -c1-6)
2829

29-
IMAGE_REPO="${GITHUB_REPOSITORY}/pr-${PR_NUMBER}"
30-
echo "IMAGE_REPO=${IMAGE_REPO}" >> $GITHUB_ENV
31-
32-
# Since this incurs a network request and can be slow, we make it optional
33-
if [ $FULL_APP_INFO ]; then
34-
APP_INFO=$(az webapp list -g ${RESOURCE_GROUP} --query "[?tags.DocsAppName == '${APP_NAME_SHORT}'].{defaultHostName:defaultHostName, name:name} | [0]")
30+
APP_NAME="${APP_NAME_BASE}-${APP_SHA}"
31+
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
3532

36-
APP_URL=$(echo $APP_INFO | jq '.defaultHostName' | tr -d '"')
37-
echo "APP_URL=${APP_URL}" >> $GITHUB_ENV
33+
APP_URL="https://${APP_NAME}.${PREVIEW_ENV_LOCATION}.azurecontainer.io"
34+
echo "APP_URL=${APP_URL}" >> $GITHUB_ENV
3835

39-
APP_NAME_FULL=$(echo $APP_INFO | jq '.name' | tr -d '"')
40-
echo "APP_NAME_FULL=${APP_NAME_FULL}" >> $GITHUB_ENV
41-
fi
36+
IMAGE_REPO="${GITHUB_REPOSITORY}/pr-${PR_NUMBER}"
37+
echo "IMAGE_REPO=${IMAGE_REPO}" >> $GITHUB_ENV

.github/actions-scripts/prod-deploy.js

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

.github/actions-scripts/staging-commit-status-success.js

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

.github/actions-scripts/staging-deploy.js

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

0 commit comments

Comments
 (0)