Skip to content

Commit da98900

Browse files
committed
Merge branch 'main' into capital-h
2 parents 7fd8e0f + f0e7705 commit da98900

2,897 files changed

Lines changed: 35808 additions & 19678 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Thanks again!
1515
<!--
1616
- If there's an existing issue for your change, please link to it.
1717
- If there's _not_ an existing issue, please open one first to make it more likely that this update will be accepted: https://github.com/github/docs/issues/new/choose. -->
18+
**Closes [issue link]**
1819

1920
### What's being changed:
2021

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Make sure the Docker container still builds
2+
3+
name: Build Docker image
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches-ignore:
11+
- translations
12+
13+
env:
14+
CI: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out repo
21+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
22+
- name: Build the container
23+
run: docker build .
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Check for External Repo Sync PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
branches:
9+
- main
10+
11+
jobs:
12+
invalid-repo-sync-check:
13+
name: Close external Repo Sync PRs
14+
if: ${{ github.repository == 'github/docs' && github.ref == 'refs/heads/repo-sync' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
18+
with:
19+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
20+
script: |
21+
22+
const prCreator = context.payload.sender.login
23+
24+
// If the PR creator is the expected account, stop now
25+
if (prCreator === 'Octomerger') {
26+
return
27+
}
28+
29+
try {
30+
await github.teams.getMembershipForUserInOrg({
31+
org: 'github',
32+
team_slug: 'employees',
33+
username: prCreator
34+
})
35+
36+
// If the PR creator is a GitHub employee, stop now
37+
return
38+
} catch (err) {
39+
// An error will be thrown if the user is not a GitHub employee.
40+
// That said, we still want to proceed anyway!
41+
}
42+
43+
const pr = context.payload.pull_request
44+
const { owner, repo } = context.repo
45+
46+
// Close the PR and add the invalid label
47+
await github.issues.update({
48+
owner: owner,
49+
repo: repo,
50+
issue_number: pr.number,
51+
labels: ['invalid'],
52+
state: 'closed'
53+
})
54+
55+
// Comment on the PR
56+
await github.issues.createComment({
57+
owner: owner,
58+
repo: repo,
59+
issue_number: pr.number,
60+
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
61+
})

.github/workflows/test-translations.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
ref: translations # check out the 'translations' branch
1919

20+
- name: Check out tip of main
21+
run: git fetch --depth=1 origin main
22+
2023
- name: Setup node
2124
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
2225
with:
@@ -41,6 +44,9 @@ jobs:
4144
- name: Run linter
4245
run: npx eslint .
4346

47+
- name: Lint translated content
48+
run: npm run lint-translation
49+
4450
- name: Check dependencies
4551
run: npm run check-deps
4652

.github/workflows/triage-stale-check.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,32 @@ on:
44
- cron: '45 16 * * *' # Run each day at 16:45 UTC / 8:45 PST
55

66
jobs:
7-
stale:
7+
stale_contributor:
88
if: github.repository == 'github/docs'
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
16-
days-before-stale: 7
17-
days-before-close: 10
15+
stale-pr-message: 'A stale label has been added to this pull request because it has been open 7 days with no activity. To keep this PR open, add a comment or push a commit within 3 days.'
16+
days-before-pr-stale: 7
17+
days-before-pr-close: 3
1818
stale-pr-label: 'stale'
19-
exempt-pr-labels: 'never-stale'
20-
exempt-issue-labels: 'never-stale'
19+
exempt-pr-labels: 'waiting for review'
20+
stale_staff:
21+
if: github.repository == 'github/docs'
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
25+
with:
26+
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for review.'
28+
days-before-pr-stale: 14
29+
days-before-pr-close: -1 # Never close
30+
only-labels: 'waiting for review'
31+
# The hope is that by setting the stale-pr-label to the same label
32+
# as the label that the stale check looks for, this will result in
33+
# a comment being posted every 14 days as an infinite loop, which is what
34+
# we want
35+
stale-pr-label: 'waiting for review'

.github/workflows/triage-unallowed-contributions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
with:
7979
github-token: ${{secrets.GITHUB_TOKEN}}
8080
script: |
81-
constFilesArr = [
81+
const badFilesArr = [
8282
'translations/**',
8383
'lib/rest/static/**',
8484
'.github/workflows/**',

.github/workflows/update-graphql-files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ jobs:
6161
with:
6262
github_token: ${{ secrets.GITHUB_TOKEN }}
6363
branches: graphql-schema-update
64-
- if: ${{ steps.create-pull-request.outputs.pr_number }}
64+
- if: ${{ steps.create-pull-request.outputs.pull-request-number }}
6565
name: Approve
6666
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
6767
with:
6868
github-token: ${{ secrets.GITHUB_TOKEN }}
69-
number: ${{ steps.create-pull-request.outputs.pr_number }}
69+
number: ${{ steps.create-pull-request.outputs.pull-request-number }}

Dockerfile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11
# This Dockerfile can be used for docker-based deployments to platforms
22
# like Now or Moda, but it is currently _not_ used by our Heroku deployments
3-
# It uses three multi-stage builds: `installation`, `bundles`, and the main build.
3+
# It uses two multi-stage builds: `install` and the main build to keep the image size down.
44

55
# --------------------------------------------------------------------------------
6-
# INSTALLATION IMAGE
7-
# A temporary image that installs production-only dependencies
6+
# INSTALL IMAGE
7+
# A temporary image that installs production-only dependencies and builds the production-ready front-end bundles.
88

9-
FROM node:14-alpine as installation
9+
FROM node:14-alpine as install
10+
RUN apk add --no-cache python make g++
1011
ENV NODE_ENV production
1112
WORKDIR /usr/src/docs
1213
COPY package*.json ./
13-
14-
# Install the project's dependencies
15-
RUN npm ci
16-
17-
# --------------------------------------------------------------------------------
18-
# BUNDLE IMAGE
19-
# A temporary image that installs dependencies and builds the production-ready front-end bundles.
20-
21-
FROM node:14-alpine as bundles
22-
WORKDIR /usr/src/docs
23-
# Install the files used to create the bundles
24-
COPY package*.json ./
2514
COPY javascripts ./javascripts
2615
COPY stylesheets ./stylesheets
2716
COPY lib ./lib
2817
COPY webpack.config.js ./webpack.config.js
29-
# Install the project's dependencies and build the bundles
30-
RUN npm ci && npm run build
18+
RUN npm ci --production
19+
RUN npm run build
3120

3221
# --------------------------------------------------------------------------------
3322
# MAIN IMAGE
@@ -44,24 +33,31 @@ RUN chown node:node /usr/src/docs -R
4433
USER node
4534

4635
# Copy our dependencies
47-
COPY --chown=node:node --from=installation /usr/src/docs/node_modules /usr/src/docs/node_modules
36+
COPY --chown=node:node --from=install /usr/src/docs/node_modules /usr/src/docs/node_modules
4837

4938
# Copy our front-end code
50-
COPY --chown=node:node --from=bundles /usr/src/docs/dist /usr/src/docs/dist
39+
COPY --chown=node:node --from=install /usr/src/docs/dist /usr/src/docs/dist
5140

5241
# We should always be running in production mode
5342
ENV NODE_ENV production
5443

44+
# Use Lunr instead of Algolia
45+
ENV USE_LUNR true
46+
5547
# Copy only what's needed to run the server
5648
COPY --chown=node:node assets ./assets
5749
COPY --chown=node:node content ./content
5850
COPY --chown=node:node data ./data
5951
COPY --chown=node:node includes ./includes
52+
COPY --chown=node:node layouts ./layouts
6053
COPY --chown=node:node lib ./lib
6154
COPY --chown=node:node middleware ./middleware
6255
COPY --chown=node:node translations ./translations
6356
COPY --chown=node:node server.js ./server.js
6457
COPY --chown=node:node package*.json ./
58+
COPY --chown=node:node feature-flags.json ./
6559

60+
EXPOSE 80
6661
EXPOSE 443
62+
EXPOSE 4000
6763
CMD ["node", "server.js"]
49.5 KB
Loading
49.4 KB
Loading

0 commit comments

Comments
 (0)