1
0
mirror of synced 2026-01-29 12:00:58 -05:00

Merge branch 'main' into actions-do-not-get-INPUT_environment-variables

This commit is contained in:
Janice
2021-06-28 15:04:25 -07:00
committed by GitHub
15 changed files with 56 additions and 41 deletions

View File

@@ -5,6 +5,7 @@ name: Open Enterprise release or deprecation issue
# **Who does it impact**: Docs engineering, docs content.
on:
workflow_dispatch:
schedule:
- cron: '49 14 * * *' # At 14:49 UTC daily
@@ -28,11 +29,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update enterprise dates
if: steps.existingIssue.outputs.deprecationIssue == 'false' || steps.existingIssue.outputs.releaseIssue == 'false'
if: steps.existingIssue.outputs.deprecationIssue == 'false' || steps.existingIssue.outputs.releaseIssue == 'false'
run: |
script/update-enterprise-dates.js
env:
GITHUB_TOKEN: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT }}
- name: Create an enterprise release issue
if: steps.existingIssue.outputs.releaseIssue == 'false'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -198,7 +198,7 @@ With your dev container added and a basic understanding of what everything does,
## Step 4: Run your application
In the previous section, you used the `postCreateCommand` to installing a set of packages via pip3. With our dependencies now installed, we can run our application.
In the previous section, you used the `postCreateCommand` to install a set of packages via the `dotnet restore` command. With our dependencies now installed, we can run our application.
1. Run your application by pressing `F5` or entering `dotnet watch run` in your terminal.

View File

@@ -9,18 +9,27 @@ redirect_from:
- /github/setting-up-and-managing-your-github-user-account/managing-your-theme-settings
shortTitle: Manage theme settings
---
For choice and flexibility in how and when you use {% data variables.product.product_name %}, you can configure theme settings to change how {% data variables.product.product_name %} looks to you. You can choose from themes that are light or dark, or you can configure {% data variables.product.product_name %} to follow your system settings. You may want to use a dark theme to reduce power consumption on certain devices, to reduce eye strain in low-light conditions, or because you prefer how the theme looks.
For choice and flexibility in how and when you use {% data variables.product.product_name %}, you can configure theme settings to change how {% data variables.product.product_name %} looks to you. You can choose from themes that are light or dark, or you can configure {% data variables.product.product_name %} to follow your system settings.
You may want to use a dark theme to reduce power consumption on certain devices, to reduce eye strain in low-light conditions, or because you prefer how the theme looks.{% ifversion fpt or ghae-issue-4618 %} People with visual impairment may benefit from the dark high contrast theme, with greater contrast between foreground and background elements.{% endif %}
{% ifversion fpt %}{% note %}
**Note:** The dark high contrast theme is currently available as a public beta. You can enable the dark high contrast theme using feature preview. For more information, see "[Exploring beta releases with feature preview](/get-started/using-github/exploring-early-access-releases-with-feature-preview#exploring-beta-releases-with-feature-preview)."
{% endnote %}{% endif %}
{% data reusables.user_settings.access_settings %}
1. In the user settings sidebar, click **Appearance**.
!["Appearance" tab in user settings sidebar](/assets/images/help/settings/appearance-tab.png)
1. Under "Theme mode", select the drop-down menu, then click a theme preference.
![Drop-down menu under "Theme mode" for selection of theme preference](/assets/images/help/settings/theme-mode-drop-down-menu.png)
1. Click the theme you'd like to use.
1. Click the theme you'd like to use.{% ifversion fpt %} If you'd like to use the dark high contrast theme, you must enable the theme in feature preview. For more information, see "[Exploring beta releases with feature preview](/get-started/using-github/exploring-early-access-releases-with-feature-preview#exploring-beta-releases-with-feature-preview)."{% endif %}
- If you chose a single theme, click a theme.
![Radio buttons for the choice of a single theme](/assets/images/help/settings/theme-choose-a-single-theme.png)
{% ifversion fpt or ghae-issue-4618 %}![Radio buttons for the choice of a single theme](/assets/images/help/settings/theme-choose-a-single-theme-highcontrast.png){% else %}![Radio buttons for the choice of a single theme](/assets/images/help/settings/theme-choose-a-single-theme.png){% endif %}
- If you chose to follow your system settings, click a day theme and a night theme.
![Buttons for the choice of a theme to sync with the system setting](/assets/images/help/settings/theme-choose-a-day-and-night-theme-to-sync.png)
{% ifversion fpt or ghae-issue-4618 %}![Buttons for the choice of a theme to sync with the system setting](/assets/images/help/settings/theme-choose-a-day-and-night-theme-to-sync-highcontrast.png){% else %}![Buttons for the choice of a theme to sync with the system setting](/assets/images/help/settings/theme-choose-a-day-and-night-theme-to-sync.png){% endif %}
## Further reading

View File

@@ -102,7 +102,6 @@ Library name | Repository | metacpan Website for the Library
Library name | Repository
|---|---|
**PHP GitHub API**|[KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api)
**GitHub API**|[yiiext/github-api](https://github.com/yiiext/github-api)
**GitHub Joomla! Package**|[joomla-framework/github-api](https://github.com/joomla-framework/github-api)
**GitHub bridge for Laravel**|[GrahamCampbell/Laravel-GitHub](https://github.com/GrahamCampbell/Laravel-GitHub)

View File

@@ -32,6 +32,6 @@ module.exports = async function archivedEnterpriseVersionsAssets (req, res, next
res.set('cache-control', `public, max-age=${ONE_DAY}`)
return res.send(r.body)
} catch (err) {
return next()
return next(404)
}
}

View File

@@ -6,7 +6,7 @@ const versionSatisfiesRange = require('../lib/version-satisfies-range')
const isArchivedVersion = require('../lib/is-archived-version')
const got = require('got')
const readJsonFile = require('../lib/read-json-file')
const archvivedRedirects = readJsonFile('./lib/redirects/static/archived-redirects-from-213-to-217.json')
const archivedRedirects = readJsonFile('./lib/redirects/static/archived-redirects-from-213-to-217.json')
const archivedFrontmatterFallbacks = readJsonFile('./lib/redirects/static/archived-frontmatter-fallbacks.json')
// This module handles requests for deprecated GitHub Enterprise versions
@@ -29,54 +29,49 @@ module.exports = async function archivedEnterpriseVersions (req, res, next) {
// starting with 2.18, we updated the archival script to create a redirects.json file
if (versionSatisfiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`) &&
versionSatisfiesRange(requestedVersion, `<=${lastVersionWithoutArchivedRedirectsFile}`)) {
const redirect = archvivedRedirects[req.path]
const redirect = archivedRedirects[req.path]
if (redirect && redirect !== req.path) {
return res.redirect(301, redirect)
}
}
let reqPath = req.path
let isRedirect = false
if (versionSatisfiesRange(requestedVersion, `>${lastVersionWithoutArchivedRedirectsFile}`)) {
try {
const res = await got(getProxyPath('redirects.json', requestedVersion))
const redirectJson = JSON.parse(res.body)
const r = await got(getProxyPath('redirects.json', requestedVersion))
const redirectJson = JSON.parse(r.body)
// make redirects found via redirects.json redirect with a 301
if (redirectJson[req.path]) {
isRedirect = true
res.set('x-robots-tag', 'noindex')
return res.redirect(301, redirectJson[req.path])
}
reqPath = redirectJson[req.path] || req.path
} catch (err) {
// nooop
// noop
}
}
try {
const r = await got(getProxyPath(reqPath, requestedVersion))
res.set('content-type', r.headers['content-type'])
const r = await got(getProxyPath(req.path, requestedVersion))
res.set('x-robots-tag', 'noindex')
// make redirects found via redirects.json return 301 instead of 200
if (isRedirect) {
res.status(301)
res.set('location', reqPath)
}
// make stubbed redirect files (which exist in versions <2.13) return 301 instead of 200
// make stubbed redirect files (which exist in versions <2.13) redirect with a 301
const staticRedirect = r.body.match(patterns.staticRedirect)
if (staticRedirect) {
res.status(301)
res.set('location', staticRedirect[1])
return res.redirect(301, staticRedirect[1])
}
res.set('content-type', r.headers['content-type'])
return res.send(r.body)
} catch (err) {
for (const fallbackRedirect of getFallbackRedirects(req, requestedVersion) || []) {
try {
await got(getProxyPath(fallbackRedirect, requestedVersion))
return res.redirect(301, fallbackRedirect)
} catch (err) { } // noop
} catch (err) {
// noop
}
}
return next()
}
}

View File

@@ -15,5 +15,5 @@ module.exports = async function handleNextDataPath (req, res, next) {
req.pagePath = req.path
}
next()
return next()
}

View File

@@ -160,6 +160,10 @@ module.exports = function (app) {
}))
app.use('/events', asyncMiddleware(instrument(events, './events')))
app.use('/search', asyncMiddleware(instrument(search, './search')))
// Check for a dropped connection before proceeding (again)
app.use(haltOnDroppedConnection)
app.use(asyncMiddleware(instrument(archivedEnterpriseVersions, './archived-enterprise-versions')))
app.use(instrument(robots, './robots'))
app.use(/(\/.*)?\/early-access$/, instrument(earlyAccessLinks, './contextualizers/early-access-links'))

View File

@@ -1,11 +1,11 @@
const { FEATURE_NEXTJS } = process.env;
const { FEATURE_NEXTJS } = process.env
module.exports = function isNextRequest(req, res, next) {
req.renderWithNextjs = false;
module.exports = function isNextRequest (req, res, next) {
req.renderWithNextjs = false
if (FEATURE_NEXTJS) {
req.renderWithNextjs = true;
req.renderWithNextjs = true
}
next();
};
return next()
}

View File

@@ -15,7 +15,7 @@ function renderPageWithNext (req, res, next) {
return nextHandleRequest(req, res)
}
next()
return next()
}
renderPageWithNext.nextHandleRequest = nextHandleRequest

View File

@@ -27,10 +27,17 @@ router.get('/', async function postSearch (req, res, next) {
const results = process.env.AIRGAP || req.cookies.AIRGAP
? await loadLunrResults({ version, language, query: `${query} ${filters || ''}`, limit })
: await loadAlgoliaResults({ version, language, query, filters, limit })
return res.status(200).json(results)
// Only reply if the headers have not been sent and the request was not aborted...
if (!res.headersSent && !req.aborted) {
return res.status(200).json(results)
}
} catch (err) {
console.error(err)
return res.status(400).json([])
// Only reply if the headers have not been sent and the request was not aborted...
if (!res.headersSent && !req.aborted) {
return res.status(400).json([])
}
}
})

View File

@@ -191,7 +191,7 @@ describe('redirects', () => {
test('frontmatter redirect', async () => {
const res = await get('/enterprise/2.12/user/articles/github-flavored-markdown')
expect(res.statusCode).toBe(301)
expect(res.text).toContain('location=\'/enterprise/2.12/user/categories/writing-on-github/\'')
expect(res.headers.location).toBe('/enterprise/2.12/user/categories/writing-on-github/')
})
})