Skip to content

Commit ba50ad5

Browse files
authored
Merge pull request #43319 from github/repo-sync
Repo sync
2 parents 41efe77 + 037d284 commit ba50ad5

File tree

10 files changed

+82
-80
lines changed

10 files changed

+82
-80
lines changed

.github/workflows/content-pipelines.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ jobs:
9191
fi
9292
9393
- name: Run content pipeline update script
94-
id: update
9594
env:
9695
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
9796
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -128,32 +127,31 @@ jobs:
128127
git push origin "$UPDATE_BRANCH"
129128
fi
130129
130+
- name: Read source repo info from config
131+
id: source-info
132+
env:
133+
PIPELINE_ID: ${{ matrix.id }}
134+
run: |
135+
SOURCE_REPO=$(yq -r ".[\"${PIPELINE_ID}\"].\"source-repo\"" src/content-pipelines/config.yml)
136+
SOURCE_PATH=$(yq -r ".[\"${PIPELINE_ID}\"].\"source-path\"" src/content-pipelines/config.yml)
137+
echo "source_repo=$SOURCE_REPO" >> "$GITHUB_OUTPUT"
138+
echo "source_path=$SOURCE_PATH" >> "$GITHUB_OUTPUT"
139+
131140
- name: Create or update PR
132141
if: steps.commit.outputs.has_changes == 'true'
133142
env:
134143
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
135144
UPDATE_BRANCH: ${{ steps.branch.outputs.update_branch }}
136145
PIPELINE_ID: ${{ matrix.id }}
137-
COMPARE_URL: ${{ steps.update.outputs.compare_url }}
138-
SHORT_RANGE: ${{ steps.update.outputs.short_range }}
146+
SOURCE_REPO: ${{ steps.source-info.outputs.source_repo }}
147+
SOURCE_PATH: ${{ steps.source-info.outputs.source_path }}
139148
run: |
140149
PR_NUMBER="${{ steps.check-pr.outputs.pr_number }}"
141150
PR_TITLE="docs: update ${PIPELINE_ID} content from source docs"
142-
NEW_ITEM="* [\`${SHORT_RANGE}\`](${COMPARE_URL})"
151+
SOURCE_LINK="See the [upstream repo](https://github.com/${SOURCE_REPO}/tree/main/${SOURCE_PATH}) for changes that triggered this update."
143152
144153
if [ -n "$PR_NUMBER" ]; then
145-
echo "PR #$PR_NUMBER already exists — appending source changes to body"
146-
147-
EXISTING_BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body')
148-
149-
# Append a new bullet before the SOURCE_CHANGES end marker
150-
# Uses bash parameter expansion for safe literal string replacement
151-
MARKER="<!-- /SOURCE_CHANGES -->"
152-
INSERTION="${NEW_ITEM}"$'\n'
153-
INSERTION+="${MARKER}"
154-
UPDATED_BODY="${EXISTING_BODY/$MARKER/$INSERTION}"
155-
156-
gh pr edit "$PR_NUMBER" --body "$UPDATED_BODY"
154+
echo "PR #$PR_NUMBER already exists"
157155
158156
echo "Ensuring PR #$PR_NUMBER is marked ready for review"
159157
gh pr ready "$PR_NUMBER" || echo "Unable to mark PR #$PR_NUMBER as ready (it may already be ready)"
@@ -166,10 +164,7 @@ jobs:
166164
PR_BODY+="## What this does"$'\n\n'
167165
PR_BODY+="Runs the \`content-pipeline-update\` agent (${PIPELINE_ID}) against the latest source docs and updates official articles under \`content/\` that have fallen out of sync."$'\n\n'
168166
PR_BODY+="## Source changes"$'\n\n'
169-
PR_BODY+="Changes in the source repo that triggered this update:"$'\n\n'
170-
PR_BODY+="<!-- SOURCE_CHANGES -->"$'\n'
171-
PR_BODY+="${NEW_ITEM}"$'\n'
172-
PR_BODY+="<!-- /SOURCE_CHANGES -->"$'\n\n'
167+
PR_BODY+="${SOURCE_LINK}"$'\n\n'
173168
PR_BODY+="## Review"$'\n\n'
174169
PR_BODY+="* Review each commit for accuracy — the agent uses AI, so spot-check important changes"$'\n'
175170
PR_BODY+="* To adjust agent behavior, see [Modifying results](${{ github.server_url }}/${{ github.repository }}/blob/main/src/content-pipelines/README.md#modifying-results)"$'\n'

.github/workflows/validate-openapi-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3232

3333
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
34+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
3535

3636
- name: Build Docker image
3737
run: |

content/site-policy/privacy-policies/github-subprocessors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ If you have questions about this list, please contact us at <privacy@github.com>
4343
| OpenAI | AI Inference and AI Services | United States | United States |
4444
| Oracle America, Inc. | Cloud Hosted Infrastructure | United States | United States |
4545
| Pusher | Building and managing real-time infrastructure for web and mobile applications | United States | United States |
46+
| Tines Automation Inc. | Security management | United States | United States |
4647
| Twilio (SendGrid) | SMS notification provider for 2 Factor Authentication | United States | United States |
4748
| xAI | AI Inference and AI Services | United States | United States |
4849
| Zendesk | Customer support ticketing system | United States | United States |

data/ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ header:
99
' is currently available as a <a href="/admin/overview/about-upgrades-to-new-releases">release candidate</a>.'
1010
early_access: 📣 Please <b>do not share</b> this URL publicly. This page contains content about a private preview feature.
1111
release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
12+
machine_translation: Some of this page may have been machine-translated or translated using AI.
1213
# GHES release notes
1314
ghes_release_notes_upgrade_patch_only: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of Enterprise Server.
1415
ghes_release_notes_upgrade_release_only: 📣 This is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server.

package-lock.json

Lines changed: 35 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"escape-string-regexp": "5.0.0",
193193
"express": "^5.2.1",
194194
"fastest-levenshtein": "1.0.16",
195-
"file-type": "21.0.0",
195+
"file-type": "21.3.1",
196196
"flat": "^6.0.1",
197197
"github-slugger": "^2.0.0",
198198
"glob": "13.0.2",

src/content-pipelines/scripts/update.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -325,23 +325,6 @@ async function main(): Promise<void> {
325325
console.log(`\nUpdated ${SHA_FILE} to ${currentSha}`)
326326
}
327327

328-
// ---- Write source change metadata to $GITHUB_OUTPUT ----
329-
// The workflow uses these values to populate the PR body with reviewer breadcrumbs.
330-
const ghOutput = process.env.GITHUB_OUTPUT
331-
if (ghOutput) {
332-
const compareUrl = storedSha
333-
? `https://github.com/${SOURCE_REPO}/compare/${storedSha}...${currentSha}`
334-
: `https://github.com/${SOURCE_REPO}/commit/${currentSha}`
335-
const shortRange = storedSha
336-
? `${storedSha.slice(0, 7)}...${currentSha.slice(0, 7)}`
337-
: currentSha.slice(0, 7)
338-
339-
const outputLines = [`compare_url=${compareUrl}`, `short_range=${shortRange}`]
340-
341-
fs.appendFileSync(ghOutput, `${outputLines.join('\n')}\n`)
342-
console.log('Wrote source change metadata to $GITHUB_OUTPUT')
343-
}
344-
345328
console.log('Done.')
346329
}
347330

src/fixtures/fixtures/data/ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ header:
99
' is currently available as a <a href="/admin/overview/about-upgrades-to-new-releases">release candidate</a>.'
1010
early_access: 📣 Please <b>do not share</b> this URL publicly. This page contains content about a private preview feature.
1111
release_notes_use_latest: Please use the latest release for the latest security, performance, and bug fixes.
12+
machine_translation: Some of this page may have been machine-translated or translated using AI.
1213
# GHES release notes
1314
ghes_release_notes_upgrade_patch_only: 📣 This is not the <a href="#{{ latestPatch }}">latest patch release</a> of Enterprise Server.
1415
ghes_release_notes_upgrade_release_only: 📣 This is not the <a href="/enterprise-server@{{ latestRelease }}/admin/release-notes">latest release</a> of Enterprise Server.

src/frame/components/page-header/HeaderNotifications.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect } from 'react'
1+
import { useEffect, useState } from 'react'
22
import { useRouter } from 'next/router'
33
import cx from 'classnames'
44
import { XIcon } from '@primer/octicons-react'
@@ -11,11 +11,14 @@ import { useVersion } from '@/versions/components/useVersion'
1111
import { useUserLanguage } from '@/languages/components/useUserLanguage'
1212
import styles from './HeaderNotifications.module.scss'
1313
import { useSharedUIContext } from '@/frame/components/context/SharedUIContext'
14+
import Cookies from '@/frame/components/lib/cookies'
15+
import { MACHINE_TRANSLATION_BANNER_COOKIE_NAME } from '@/frame/lib/constants'
1416

1517
enum NotificationType {
1618
RELEASE = 'RELEASE',
1719
TRANSLATION = 'TRANSLATION',
1820
EARLY_ACCESS = 'EARLY_ACCESS',
21+
MACHINE_TRANSLATION = 'MACHINE_TRANSLATION',
1922
}
2023

2124
type Notif = {
@@ -36,6 +39,11 @@ export const HeaderNotifications = () => {
3639

3740
const { t } = useTranslation('header')
3841

42+
const [machineTranslationDismissed, setMachineTranslationDismissed] = useState(true)
43+
useEffect(() => {
44+
setMachineTranslationDismissed(Cookies.get(MACHINE_TRANSLATION_BANNER_COOKIE_NAME) === 'true')
45+
}, [])
46+
3947
const translationNotices: Array<Notif> = []
4048
if (router.locale === 'en') {
4149
if (userLanguage && userLanguage !== 'en' && languages[userLanguage]) {
@@ -61,6 +69,22 @@ export const HeaderNotifications = () => {
6169
})
6270
}
6371
}
72+
73+
if (router.locale !== 'en' && !machineTranslationDismissed) {
74+
translationNotices.push({
75+
type: NotificationType.MACHINE_TRANSLATION,
76+
content: t('notices.machine_translation'),
77+
onClose: () => {
78+
setMachineTranslationDismissed(true)
79+
try {
80+
Cookies.set(MACHINE_TRANSLATION_BANNER_COOKIE_NAME, 'true')
81+
} catch (err) {
82+
console.warn('Unable to set cookie', err)
83+
}
84+
},
85+
})
86+
}
87+
6488
const releaseNotices: Array<Notif> = []
6589
if (currentVersion === data.variables.release_candidate.version) {
6690
releaseNotices.push({
@@ -100,6 +124,7 @@ export const HeaderNotifications = () => {
100124
styles.container,
101125
'text-center f5 color-fg-default py-4 px-6 z-1',
102126
type === NotificationType.TRANSLATION && 'color-bg-accent',
127+
type === NotificationType.MACHINE_TRANSLATION && 'color-bg-accent',
103128
type === NotificationType.RELEASE && 'color-bg-accent',
104129
type === NotificationType.EARLY_ACCESS && 'color-bg-danger',
105130
!isLast && 'border-bottom color-border-default',

src/frame/lib/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const DEFAULT_MAX_REQUEST_TIMEOUT = isDev ? 15_000 : 10_000
1212

1313
export const ROOT = process.env.ROOT || '.'
1414
export const USER_LANGUAGE_COOKIE_NAME = 'user_language'
15+
export const MACHINE_TRANSLATION_BANNER_COOKIE_NAME = 'machine_translation_banner_seen'
1516
export const USER_VERSION_COOKIE_NAME = 'user_version'
1617
export const TRANSLATIONS_ROOT = process.env.TRANSLATIONS_ROOT || 'translations'
1718
export const MAX_REQUEST_TIMEOUT = process.env.REQUEST_TIMEOUT

0 commit comments

Comments
 (0)