Skip to content

Commit 8e6587b

Browse files
Merge branch 'main' into patch-1
2 parents 3ae44f1 + 527f5e9 commit 8e6587b

File tree

422 files changed

+9174
-20156
lines changed

Some content is hidden

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

422 files changed

+9174
-20156
lines changed

β€Ž.github/actions/node-npm-setup/action.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}-${{ hashFiles('.github/actions/node-npm-setup/action.yml') }}
1818

1919
- name: Setup Node.js
20-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
20+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2121
with:
2222
node-version-file: 'package.json'
2323
cache: npm

β€Ž.github/instructions/code.instructions.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ For code reviews, follow guidelines, tests, and validate instructions. For creat
1616
- Avoid pull requests with over 300 lines of code changed. When significantly larger, offer to split up into smaller pull requests if possible.
1717
- All new code should be written in TypeScript and not JavaScript.
1818
- We use absolute imports, relative to the `src` directory, using the `@` symbol. For example, `getRedirect` which lives in `src/redirects/lib/get-redirect.ts` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`. The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
19+
- For updates to the content linter, read important information in `src/content-linter/README.md`.
1920

2021
## Tests
2122

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Auto-add ready-for-doc-review label
2+
3+
# **What it does**: Automatically adds the "ready-for-doc-review" label to DIY docs PRs that contain content or data changes when they are opened in a non-draft state or converted from draft to ready for review.
4+
# **Why we have it**: To ensure DIY docs PRs are automatically added to the docs-content review board without requiring manual labeling.
5+
# **Who does it impact**: Contributors making content changes and docs-content reviewers.
6+
7+
on:
8+
pull_request:
9+
types:
10+
- opened
11+
- ready_for_review
12+
paths:
13+
- 'content/**'
14+
- 'data/**'
15+
16+
permissions:
17+
contents: read
18+
pull-requests: write
19+
20+
jobs:
21+
add-review-label:
22+
name: Add ready-for-doc-review label to DIY docs PRs
23+
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.actor != 'github-openapi-bot' && github.actor != 'docs-bot'
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Check out repo
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
30+
- name: Check team membership
31+
id: membership_check
32+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
33+
with:
34+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
35+
script: |
36+
try {
37+
await github.rest.teams.getMembershipForUserInOrg({
38+
org: 'github',
39+
team_slug: 'docs',
40+
username: context.payload.sender.login,
41+
});
42+
return true
43+
} catch(err) {
44+
console.log(err)
45+
return false
46+
}
47+
48+
- name: Add ready-for-doc-review label
49+
if: steps.membership_check.outputs.result == 'false'
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
PR_URL: ${{ github.event.pull_request.html_url }}
53+
run: |
54+
gh pr edit $PR_URL --add-label ready-for-doc-review
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Feedback prompt for non-Docs team contributors when a PR is closed
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
comment-on-pr:
13+
# This workflow should only run on the 'github/docs-internal' repository because it posts a feedback request
14+
# to non-Docs team contributors when their PR is merged into the main branch.
15+
# The feedback request asks contributors to leave feedback on their contributing experience in Slack.
16+
if: github.repository == 'github/docs-internal' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Check if PR author is in docs-content team
22+
id: check_team
23+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
24+
with:
25+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
26+
script: |
27+
try {
28+
const pr = context.payload.pull_request;
29+
await github.rest.teams.getMembershipForUserInOrg({
30+
org: 'github',
31+
team_slug: 'docs-content',
32+
username: pr.user.login,
33+
});
34+
// Author is in the team. Do nothing!
35+
} catch(err) {
36+
// Author not in team
37+
core.exportVariable('NON_DOCS_HUBBER', 'true');
38+
}
39+
40+
- name: Post changelog instructions comment
41+
42+
if: env.NON_DOCS_HUBBER == 'true'
43+
44+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
45+
with:
46+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
47+
script: |
48+
// Get PR author username
49+
const pr = context.payload.pull_request;
50+
const prAuthor = pr.user.login;
51+
52+
// Compose the comment body as a plain text message to post on the PR
53+
const commentBody =
54+
"πŸ‘‹ @" + prAuthor +
55+
" - Please leave us feedback on your contributing experience! " +
56+
"To do this, please go to `#docs-contributor-feedback` on Slack.";
57+
58+
// Post the comment
59+
await github.rest.issues.createComment({
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
issue_number: pr.number,
63+
body: commentBody
64+
});

β€Ž.github/workflows/first-responder-v2-prs-collect.ymlβ€Ž

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: Add docs-internal PRs to the docs-content FR project v2
1+
name: Add maintenance PRs to the docs-content FR project v2
22

3-
# **What it does**: Adds docs-internal pull requests that were opened by people outside of the docs team to the docs-content FR project v2
4-
# **Why we have it**: So we don't lose track of new pull requests for docs-content to review
3+
# **What it does**: Adds docs-internal pull requests authored by docs-bot to the docs-content FR project v2
4+
# **Why we have it**: So we don't lose track of maintenance pull requests for docs-content to review
55
# **Who does it impact**: Docs content
66

77
on:
@@ -18,76 +18,34 @@ permissions:
1818

1919
jobs:
2020
first-responder-triage-pr:
21-
name: Add PR to FR project v2
22-
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.actor != 'dependabot[bot]' && github.event.pull_request.head.ref != 'repo-sync' && !contains(github.event.pull_request.labels.*.name, 'skip FR board')
21+
name: Add maintenance PR to FR project v2
22+
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.event.pull_request.user.id == 77750099 && github.event.pull_request.head.ref != 'repo-sync' && !contains(github.event.pull_request.labels.*.name, 'skip FR board')
2323
runs-on: ubuntu-latest
2424

2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v5
2828

29-
- name: Check if the event originated from a team member
30-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
31-
id: check-membership
32-
with:
33-
github-token: ${{secrets.DOCS_BOT_PAT_BASE}}
34-
result-encoding: string
35-
script: |
36-
const repoName = context.payload.repository.name
37-
const ownerName = context.payload.repository.owner.login
38-
const prAuthor = context.payload.pull_request.user.login
39-
const teamMembers = await github.request(
40-
`/orgs/github/teams/docs/members?per_page=100`
41-
)
42-
const teamLogins = teamMembers.data.map(member => member.login)
43-
if (teamLogins.some(login => login === prAuthor)) {
44-
console.log(`This pull request was authored by a member of the github/docs team.`)
45-
return 'true'
46-
}
47-
console.log(`This pull request was authored by an external contributor.`)
48-
return 'false'
49-
50-
# Check if docs-bot authored the PR
51-
# If yes, set Type field to "Maintenance"
52-
# If no, set Type field to "External contributor PR"
53-
- name: Check if docs-bot is PR author
54-
env:
55-
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
56-
run: |
57-
if [ $PR_AUTHOR_ID == 77750099 ]; then
58-
echo "TYPE_FIELD_VALUE=3f142cf2" >> $GITHUB_ENV
59-
else
60-
echo "TYPE_FIELD_VALUE=bbd0922a" >> $GITHUB_ENV
61-
fi
62-
63-
- name: Add the docs-content-fr label
64-
if: ${{ steps.check-membership.outputs.result == 'false' }}
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
PR_URL: ${{ github.event.pull_request.html_url }}
68-
run: |
69-
gh pr edit $PR_URL --add-label docs-content-fr
70-
7129
# Add to the FR project
72-
# and set type to "Maintenance" or "External contributor PR"
30+
# and set type to "Maintenance"
7331
# and set date to now
7432
- name: Triage to docs-content FR project
75-
if: steps.check-membership.outputs.result == 'false'
7633
env:
7734
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
7835
PR_URL: ${{ github.event.pull_request.html_url }}
7936
PROJECT_NUMBER: 11672
8037
PROJECT_ID: PVT_kwDNJr_OAGNkBg
8138
TYPE_FIELD_ID: PVTSSF_lADNJr_OAGNkBs4D-Nyn
8239
DATE_FIELD_ID: PVTF_lADNJr_OAGNkBs4D-N1h
40+
TYPE_FIELD_VALUE: 3f142cf2
8341
run: |
8442
echo "Adding item to project..."
8543
8644
ITEM_ID=$(gh project item-add $PROJECT_NUMBER --owner github --url $PR_URL --format json | jq .id)
8745
8846
echo "Editing type..."
8947
90-
gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $TYPE_FIELD_ID --single-select-option-id ${{ env.TYPE_FIELD_VALUE }}
48+
gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $TYPE_FIELD_ID --single-select-option-id $TYPE_FIELD_VALUE
9149
9250
echo "Editing date..."
9351

β€Ž.github/workflows/hubber-contribution-help.ymlβ€Ž

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,23 @@ jobs:
4444
- name: Comment on the PR
4545
if: steps.membership_check.outputs.result == 'false'
4646
run: |
47-
gh pr comment $PR --body "### Next: add the review label
47+
gh pr comment $PR --body "## Requesting a review from the Docs team
4848
49-
**πŸ›ŽοΈ Is this PR ready for review?** A PR is ready for a docs review _after_ the self-review checklist is complete.
49+
### 🚧 Draft PRs
5050
51-
When this is ready for review, add the **\`ready-for-doc-review\`** label to this PR. The PR will then be automatically added to the [Docs Content review board](https://github.com/orgs/github/projects/2936). _Please allow at least 3 working days for a review, and longer if this is a substantial change._"
51+
To add the PR to the Docs Content review board, click **Ready for review** in the merge box.
52+
53+
### πŸš€ Non-draft PRs
54+
55+
The PR is **ready** and has automatically been added to the Docs Content review board. The docs team will review it as soon as possible.
56+
57+
### Lead time for review
58+
59+
Please allow at least 3 business days for a Docs Content review.
60+
61+
### Need help?
62+
63+
Reach out in [#docs-content](https://github-grid.enterprise.slack.com/archives/C0E9DK082) on Slack."
5264
5365
env:
5466
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
205 KB
Loading
70.8 KB
Loading
540 KB
Loading
-105 KB
Binary file not shown.

0 commit comments

Comments
Β (0)