Skip to content

Commit 37b0d16

Browse files
authoredJan 6, 2025··
Merge pull request #35844 from github/repo-sync
Repo sync
2 parents 2f8656e + 6e1ef80 commit 37b0d16

File tree

9 files changed

+34
-18
lines changed

9 files changed

+34
-18
lines changed
 

‎.github/workflows/azure-prod-build-deploy.yml

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ name: Azure Production - Build and Deploy
55
# **Who does it impact**: All contributors.
66

77
on:
8-
push:
9-
branches:
10-
- main
118
workflow_dispatch:
129

1310
permissions:

‎.github/workflows/purge-fastly.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ name: Purge Fastly
55
# **Who does it impact**: Writers and engineers.
66

77
on:
8+
deployment_status:
89
workflow_dispatch:
910
inputs:
1011
nuke_all:
@@ -16,9 +17,6 @@ on:
1617
description: "Comma separated languages. E.g. 'en,ja, es' (defaults to all)"
1718
required: false
1819
default: ''
19-
push:
20-
branches:
21-
- main
2220

2321
permissions:
2422
contents: read
@@ -29,11 +27,12 @@ env:
2927

3028
jobs:
3129
send-purges:
30+
# Run when workflow_dispatch is the event (manual) or when deployment_status is the event (automatic) and it's a successful production deploy
3231
if: >-
3332
${{
3433
github.repository == 'github/docs-internal' &&
35-
(github.event_name != 'workflow_run' ||
36-
github.event.workflow_run.conclusion == 'success')
34+
(github.event_name != 'deployment_status' ||
35+
github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'production')
3736
}}
3837
runs-on: ubuntu-latest
3938
steps:

‎config/kubernetes/production/deployments/webapp.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ spec:
2323
image: docs-internal
2424
resources:
2525
requests:
26-
cpu: 4000m
27-
memory: 5Gi
26+
cpu: 8000m
27+
memory: 10Gi
2828
limits:
29-
cpu: 4000m
29+
cpu: 16000m
3030
memory: 14Gi
3131
ports:
3232
- name: http

‎content/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform.md

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ This guide gives an overview of how to configure GCP to trust {% data variables.
2929

3030
{% data reusables.actions.oidc-on-ghecom %}
3131

32+
{% ifversion ghes %}
33+
{% data reusables.actions.oidc-endpoints %}
34+
<!-- This note is indented to align with the above reusable. -->
35+
36+
> [!NOTE]
37+
> Google Cloud Platform does not have fixed IP ranges defined for these endpoints.
38+
39+
* Make sure that the value of the issuer claim that's included with the JSON Web Token (JWT) is set to a publicly routable URL. For more information, see [AUTOTITLE](/enterprise-server@latest/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).
40+
{% endif %}
41+
3242
## Adding a Google Cloud Workload Identity Provider
3343

3444
To configure the OIDC identity provider in GCP, you will need to perform the following configuration. For instructions on making these changes, refer to [the GCP documentation](https://github.com/google-github-actions/auth).

‎data/features/viewscreen-and-notebooks.yml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
>[!NOTE] CAP protection for web sessions is currently in {% data variables.release-phases.public_preview %} and may change.
22
>
33
> If IdP CAP support is already enabled for your enterprise, you can opt into extended protection for web sessions from your enterprise's "Authentication security" settings. To enable this feature, your enterprise must have 1,000 or fewer members, active or suspended.
4+
> When web session protection is enabled and a user's IP conditions are not satisfied, they can view and filter all user-owned resources but cannot view the details of the results for notifications, searches, personal dashboards, or starred repositories.

‎src/archives/middleware/archived-enterprise-versions.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,17 @@ export default async function archivedEnterpriseVersions(
227227
// old Azure Blob Storage URL. These need to be rewritten to
228228
// the new archived enterprise repo URL.
229229
if (versionSatisfiesRange(requestedVersion, `>=${firstReleaseStoredInBlobStorage}`)) {
230+
// `x-host` is a custom header set by Fastly.
231+
// GLB automatically deletes the `x-forwarded-host` header.
232+
const host = req.get('x-host') || req.get('x-forwarded-host') || req.get('host')
230233
r.body = r.body
231234
.replaceAll(
232235
`${OLD_AZURE_BLOB_ENTERPRISE_DIR}/${requestedVersion}/assets/cb-`,
233236
`${ENTERPRISE_GH_PAGES_URL_PREFIX}${requestedVersion}/assets/cb-`,
234237
)
235238
.replaceAll(
236239
`${OLD_AZURE_BLOB_ENTERPRISE_DIR}/${requestedVersion}/`,
237-
`${req.protocol}://${req.get('x-forwarded-host') || req.get('host')}/enterprise-server@${requestedVersion}/`,
240+
`${req.protocol}://${host}/enterprise-server@${requestedVersion}/`,
238241
)
239242
}
240243

‎src/frame/middleware/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import healthz from './healthz'
3131
import manifestJson from './manifest-json'
3232
import remoteIP from './remote-ip'
3333
import buildInfo from './build-info'
34+
import reqHeaders from './req-headers'
3435
import archivedEnterpriseVersions from '@/archives/middleware/archived-enterprise-versions'
3536
import robots from './robots'
3637
import earlyAccessLinks from '@/early-access/middleware/early-access-links'
@@ -246,6 +247,7 @@ export default function (app: Express) {
246247
app.use('/api', api)
247248
app.get('/_ip', remoteIP)
248249
app.get('/_build', buildInfo)
250+
app.get('/_req-headers', reqHeaders)
249251
app.use(asyncMiddleware(manifestJson))
250252

251253
// Things like `/api` sets their own Fastly surrogate keys.

‎src/frame/middleware/req-headers.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { Request, Response } from 'express'
2+
3+
import { noCacheControl } from './cache-control.js'
4+
5+
export default function reqHeaders(req: Request, res: Response) {
6+
noCacheControl(res)
7+
res.json({
8+
'request-headers': req.headers,
9+
})
10+
}

0 commit comments

Comments
 (0)
Please sign in to comment.