Skip to content

Commit 1f7079c

Browse files
authored
Merge pull request github#16668 from github/repo-sync
repo sync
2 parents 7f267fc + 9357fa8 commit 1f7079c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/sync-search-indices.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
env:
7878
VERSION: ${{ github.event.inputs.version }}
7979
LANGUAGE: ${{ github.event.inputs.language }}
80+
# We don't want or need the changelog entries in this context.
81+
# Pages that display the content from these isn't included
82+
# in search index bodies anyway.
83+
CHANGELOG_DISABLED: true
8084
# If a reusable, or anything in the `data/*` directory is deleted
8185
# you might get a
8286
#

lib/changelog.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import path from 'path'
55
import Parser from 'rss-parser'
66

77
const CHANGELOG_CACHE_FILE_PATH = process.env.CHANGELOG_CACHE_FILE_PATH
8+
// This is useful to set when doing things like sync search.
9+
const CHANGELOG_DISABLED = Boolean(JSON.parse(process.env.CHANGELOG_DISABLED || 'false'))
810

911
async function getRssFeed(url) {
1012
const parser = new Parser({ timeout: 5000 })
@@ -22,6 +24,12 @@ async function getRssFeed(url) {
2224
}
2325

2426
export async function getChangelogItems(prefix, feedUrl, ignoreCache = false) {
27+
if (CHANGELOG_DISABLED) {
28+
if (process.env.NODE_ENV === 'development') {
29+
console.warn(`Downloading changelog (${feedUrl}) items is disabled.`)
30+
}
31+
return
32+
}
2533
if (!ignoreCache) {
2634
const fromCache = getChangelogItemsFromCache(prefix, feedUrl)
2735
if (fromCache) return fromCache

0 commit comments

Comments
 (0)