Skip to content

Repo sync #36993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 20, 2025
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
20 changes: 5 additions & 15 deletions .github/workflows/validate-github-github-docs-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ jobs:
steps:
- name: Check out repo's default branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Picking this number is a "best guess". If we make it too large,
# the checkout will take potentially unnecessariily long.
# This reduces the chance that tj-actions/changed-files has to
# fetch deeper history. But if it needs to, it will.
fetch-depth: 10

- uses: ./.github/actions/node-npm-setup

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -108,23 +101,20 @@ jobs:
# First, gather the URLs that were relevant
- name: Get changed content/data files
if: ${{ github.event_name == 'pull_request' }}
id: changed-files
uses: tj-actions/changed-files@40853de9f8ce2d6cfdc73c1b96f14e22ba44aec4 # v45.0.0
id: changed_files
uses: ./.github/actions/get-changed-files
with:
# No need to escape the file names because we make the output of
# tj-actions/changed-files be set as an environment variable. Not
# as a direct input to the line of bash that uses it.
safe_output: false
files: |
content/**
token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate PR comment
if: ${{ github.event_name == 'pull_request' && steps.changed-files.outputs.any_changed == 'true' }}
if: ${{ github.event_name == 'pull_request' && steps.changed_files.outputs.filtered_changed_files }}
env:
# Make it an environment variable so that its value doesn't need to be escaped.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
CHANGED_FILES: |-
${{ steps.changed-files.outputs.all_changed_files }}
${{ steps.changed_files.outputs.filtered_changed_files }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
REPOSITORY: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ---------------------------------------------------------------
# To update the sha:
# https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250312-190108-g24a349a95 AS base
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250319-193531-g83d4e6244 AS base

# Install curl for Node install and determining the early access branch
# Install git for cloning docs-early-access & translations repos
Expand Down
Binary file added assets/images/site/evergreens/boxwood.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/cedar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/cypress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/fir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/hemlock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/holly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/juniper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/laurel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/pine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/redwood.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/sequoia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/site/evergreens/spruce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/scripts/find-orphaned-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ const EXCEPTIONS = new Set([
'assets/images/site/apple-touch-icon-60x60.png',
'assets/images/site/apple-touch-icon-72x72.png',
'assets/images/site/apple-touch-icon-76x76.png',
'assets/images/site/evergreens/boxwood.png',
'assets/images/site/evergreens/cedar.png',
'assets/images/site/evergreens/cypress.png',
'assets/images/site/evergreens/fir.png',
'assets/images/site/evergreens/hemlock.png',
'assets/images/site/evergreens/holly.png',
'assets/images/site/evergreens/juniper.png',
'assets/images/site/evergreens/laurel.png',
'assets/images/site/evergreens/pine.png',
'assets/images/site/evergreens/redwood.png',
'assets/images/site/evergreens/sequoia.png',
'assets/images/site/evergreens/spruce.png',
])

function isExceptionPath(imagePath: string) {
Expand Down
41 changes: 33 additions & 8 deletions src/frame/pages/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,38 @@ import { useTheme } from 'src/color-schemes/components/useTheme'
type MyAppProps = AppProps & {
isDotComAuthenticated: boolean
languagesContext: LanguagesContextT
stagingName?: string
}

const MyApp = ({ Component, pageProps, languagesContext }: MyAppProps) => {
const stagingNames = new Set([
'boxwood',
'cedar',
'cypress',
'fir',
'hemlock',
'holly',
'juniper',
'laurel',
'pine',
'redwood',
'sequoia',
'spruce',
])

function getFaviconHref(stagingName?: string) {
/* The value in these "/cb-xxxxx" prefixes aren't important. They
just need to be present. They help the CDN cache the asset
for infinity.
Just remember, if you edit these images on disk, remember to
change these numbers
*/
if (stagingName) {
return `/assets/cb-345/images/site/evergreens/${stagingName}.png`
}
return '/assets/cb-345/images/site/favicon.png'
}

const MyApp = ({ Component, pageProps, languagesContext, stagingName }: MyAppProps) => {
const { theme } = useTheme()
const router = useRouter()

Expand Down Expand Up @@ -89,13 +118,7 @@ const MyApp = ({ Component, pageProps, languagesContext }: MyAppProps) => {
<title>GitHub Docs</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

{/* The value in these "/cb-xxxxx" prefixes aren't important. They
just need to be present. They help the CDN cache the asset
for infinity.
Just remember, if you edit these images on disk, remember to
change these numbers
*/}
<link rel="icon" type="image/png" href="/assets/cb-345/images/site/favicon.png" />
<link rel="icon" type="image/png" href={getFaviconHref(stagingName)} />

<link href="/manifest.json" rel="manifest" />

Expand Down Expand Up @@ -157,9 +180,11 @@ MyApp.getInitialProps = async (appContext: AppContext) => {
}
}
}
const stagingName = req.headers['x-ong-external-url']?.match(/staging-(\w+)\./)?.[1]
return {
...appProps,
languagesContext,
stagingName: stagingNames.has(stagingName) ? stagingName : undefined,
}
}

Expand Down