Skip to content

Commit 1e2aa59

Browse files
authored
Merge branch 'main' into main
2 parents 6aece8d + c0cf4cc commit 1e2aa59

17,213 files changed

Lines changed: 5032 additions & 794242 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/workflows/staging-deploy-pr.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,17 @@ jobs:
323323
name: pr_build
324324
path: ${{ runner.temp }}
325325

326-
- name: Extract user-changes to temp directory
326+
# For security reasons, only extract the tar from docs-internal
327+
# This allows us to add search indexes and early access content to the build
328+
- if: ${{ github.repository == 'github/docs-internal' }}
329+
name: Extract user-changes to temp directory
327330
run: |
328331
mkdir $RUNNER_TEMP/app
329332
tar -x --file=$RUNNER_TEMP/app.tar -C "$RUNNER_TEMP/app/"
330333
331334
# Move the LFS content into the temp directory in chunks (destructively)
332-
- name: Move the LFS objects
335+
- if: ${{ github.repository == 'github/docs-internal' }}
336+
name: Move the LFS objects
333337
run: |
334338
git lfs ls-files --name-only | xargs -n 1 -I {} sh -c 'mkdir -p "$RUNNER_TEMP/app/$(dirname {})"; mv {} "$RUNNER_TEMP/app/$(dirname {})/"'
335339
@@ -341,9 +345,15 @@ jobs:
341345
mv content/early-access "$RUNNER_TEMP/app/content/"
342346
mv data/early-access "$RUNNER_TEMP/app/data/"
343347
344-
- name: Create a gzipped archive
348+
- if: ${{ github.repository == 'github/docs-internal' }}
349+
name: Create a gzipped archive (docs-internal)
345350
run: tar -cz --file app.tar.gz "$RUNNER_TEMP/app/"
346351

352+
# gzip the app.tar from github/docs so we're working with the same format
353+
- if: ${{ github.repository == 'github/docs' }}
354+
name: Create a gzipped archive (docs)
355+
run: gzip -9 < "$RUNNER_TEMP/app.tar" > app.tar.gz
356+
347357
- name: Create a Heroku build source
348358
id: build-source
349359
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Copy to REST API issue to docs-content
2+
3+
# **What it does**: Copies an issue in the open source repo to the docs-content repo, comments on and closes the original issue
4+
# **Why we have it**: REST API updates cannot be made in the open source repo. Instead, we copy the issue to an internal issue (we do not transfer so that the issue does not disappear for the contributor) and close the original issue.
5+
# **Who does it impact**: Open source and docs-content maintainers
6+
7+
permissions:
8+
contents: write
9+
10+
on:
11+
issues:
12+
types:
13+
- labeled
14+
15+
jobs:
16+
transfer-issue:
17+
name: Transfer issue
18+
runs-on: ubuntu-latest
19+
if: (github.event.label.name == 'localization ' && github.repository == 'github/docs')
20+
steps:
21+
- name: Check if this run was triggered by a member of the docs team
22+
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
23+
id: triggered-by-member
24+
with:
25+
github-token: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
26+
result-encoding: string
27+
script: |
28+
const triggerer_login = context.payload.sender.login
29+
const teamMembers = await github.request(
30+
`/orgs/github/teams/docs/members?per_page=100`
31+
)
32+
const logins = teamMembers.data.map(member => member.login)
33+
if (logins.includes(triggerer_login)) {
34+
console.log(`This workflow was triggered by ${triggerer_login} (on the docs team).`)
35+
return 'true'
36+
}
37+
console.log(`This workflow was triggered by ${triggerer_login} (not on the docs team), so no action will be taken.`)
38+
return 'false'
39+
40+
- name: Exit if not triggered by a docs team member
41+
if: steps.triggered-by-member.outputs.result == 'false'
42+
run: |
43+
echo Aborting. This workflow must be triggered by a member of the docs team.
44+
exit 1
45+
46+
- name: Create an issue in the localization repo
47+
run: |
48+
new_issue_url="$(gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --repo github/localization)"
49+
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
50+
env:
51+
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
52+
ISSUE_TITLE: ${{ github.event.issue.title }}
53+
ISSUE_BODY: ${{ github.event.issue.body }}
54+
55+
- name: Comment on the new issue
56+
run: gh issue comment $NEW_ISSUE --body "This issue was originally opened in the open source repo as $OLD_ISSUE"
57+
env:
58+
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
59+
NEW_ISSUE: ${{ env.NEW_ISSUE }}
60+
OLD_ISSUE: ${{ github.event.issue.html_url }}
61+
62+
- name: Comment on the old issue
63+
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to translated content must be made internally. I have copied your issue to an internal issue, so I will close this issue."
64+
env:
65+
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
66+
OLD_ISSUE: ${{ github.event.issue.html_url }}
67+
68+
- name: Close the old issue
69+
run: gh issue close $OLD_ISSUE
70+
env:
71+
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
72+
OLD_ISSUE: ${{ github.event.issue.html_url }}

Dockerfile.openapi_decorator

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ COPY --chown=node:node package-lock.json /openapi-check
1313
ADD --chown=node:node script /openapi-check/script
1414
ADD --chown=node:node lib /openapi-check/lib
1515
ADD --chown=node:node content /openapi-check/content
16+
ADD --chown=node:node data /openapi-check/data
1617

1718
RUN npm ci -D
1819

221 KB
Loading
189 KB
Loading
26.4 KB
Loading
49.9 KB
Loading
65.9 KB
Loading
53.3 KB
Loading
11.1 KB
Loading

0 commit comments

Comments
 (0)