Skip to content

Commit 14e65a8

Browse files
Merge branch 'main' into fix/github-actions-major-versions
2 parents dbfdde8 + d9c9696 commit 14e65a8

File tree

1,282 files changed

+102819
-22538
lines changed

Some content is hidden

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

1,282 files changed

+102819
-22538
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for contributing to this project! You must fill out the information be
44

55
### Why:
66

7-
Closes:
7+
Closes: ISSUE_NUMBER
88

99
<!-- If there's an existing issue for your change, please link to it above.
1010
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. -->
@@ -16,6 +16,6 @@ If you made changes to the `content` directory, a table will populate in a comme
1616

1717
### Check off the following:
1818

19-
- [ ] A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require a SME review from GitHub staff.
19+
- [ ] A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
2020
- [ ] The changes in this PR meet [the docs fundamentals that are required for all content](http://docs.github.com/en/contributing/writing-for-github-docs/about-githubs-documentation-fundamentals).
21-
- [ ] All CI checks are passing.
21+
- [ ] All CI checks are passing and the changes look good in the preview environment.
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Code changes comment
2+
3+
# **What it does**: When a PR is opened in docs-internal or docs containing code, it comments with instructions on how to deploy and preview the changes.
4+
# **Why we have it**: To help Docs contributors understand how to preview their changes.
5+
# **Who does it impact**: docs-internal and docs maintainers and contributors
6+
7+
on:
8+
# Required in lieu of `pull_request` so that the comment can be posted to PRs opened from a fork.
9+
pull_request_target:
10+
types:
11+
- opened
12+
- synchronize
13+
# this applies to any non-content files, this workflow will run for all changed files unless it's ONLY these content-related changes
14+
paths-ignore:
15+
- 'content/**'
16+
- 'data/reusables/**'
17+
- 'assets/images/**'
18+
19+
permissions:
20+
contents: read
21+
pull-requests: write
22+
23+
# This allows a subsequently queued workflow run to interrupt previous runs
24+
concurrency:
25+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
26+
cancel-in-progress: true
27+
28+
jobs:
29+
postOnCodeChanges:
30+
if: ${{ github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') }}
31+
runs-on: ubuntu-latest
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
steps:
35+
- name: check out repo content
36+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
38+
- name: Find code changes comment
39+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
40+
id: findComment
41+
with:
42+
issue-number: ${{ github.event.pull_request.number }}
43+
comment-author: 'github-actions[bot]'
44+
body-includes: '<!-- CODE_CHANGES_COMMENT -->'
45+
46+
# TODO: We'll update this comment at a later time with permament-ish links to deployment instructions.
47+
- name: Comment on code changes
48+
if: ${{ !steps.findComment.outputs.comment-id }}
49+
run: |
50+
if [[ "${{ github.repository }}" == "github/docs" ]]; then
51+
COMMENT_BODY="<!-- CODE_CHANGES_COMMENT -->
52+
## 🚀 Manual Deployment Required
53+
54+
It looks like this pull request contains code changes. To preview these changes, an internal Hubber will need to manually deploy the changes to one of our staging servers.
55+
56+
Thank you for your contribution!"
57+
else
58+
COMMENT_BODY="<!-- CODE_CHANGES_COMMENT -->
59+
## 🚀 Manual Deployment Required
60+
61+
It looks like this pull request contains code changes. To preview these changes, you will need to deploy them manually.
62+
63+
Thank you for your contribution!"
64+
fi
65+
66+
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT_BODY"

.github/workflows/codeowners-content-systems.yml

-34
This file was deleted.

.github/workflows/content-changes-table-comment.yml

+18-11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ on:
2828
paths:
2929
- 'content/**'
3030
- 'data/reusables/**'
31+
- 'assets/images/**'
3132

3233
permissions:
3334
contents: read
@@ -48,21 +49,28 @@ jobs:
4849
- name: check out repo content
4950
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5051

51-
- name: Get preview app info
52-
env:
53-
APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }}
54-
run: src/workflows/get-preview-app-info.sh
55-
5652
- uses: ./.github/actions/node-npm-setup
5753

54+
# We're setting the URLs manually until we merge in-progress work. We can utilize review server and its helper functions in a later iteration.
55+
- name: Set APP_URL
56+
run: |
57+
if [[ "${{ github.repository }}" == "github/docs-internal" ]]; then
58+
echo "APP_URL=https://docs-review.github.com" >> $GITHUB_ENV
59+
elif [[ "${{ github.repository }}" == "github/docs" ]]; then
60+
echo "APP_URL=https://os-docs-review.github.com" >> $GITHUB_ENV
61+
fi
62+
5863
- name: Get changes table
5964
id: changes
6065
timeout-minutes: 30
6166
env:
6267
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
REVIEW_SERVER_ACCESS_TOKEN: ${{ secrets.REVIEW_SERVER_ACCESS_TOKEN }}
6369
APP_URL: ${{ env.APP_URL }}
6470
BASE_SHA: ${{ github.event.pull_request.base.sha || inputs.BASE_SHA }}
6571
HEAD_SHA: ${{ github.event.pull_request.head.sha || inputs.HEAD_SHA }}
72+
# HEAD_BRANCH isn't necessary for the table comment, but lets us list the branch in the review server menu bar
73+
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
6674
run: npm run content-changes-table-comment
6775

6876
- name: Find content directory changes comment
@@ -81,10 +89,10 @@ jobs:
8189
issue-number: ${{ github.event.pull_request.number || inputs.PR_NUMBER }}
8290
body: |
8391
<!-- MODIFIED_CONTENT_LINKING_COMMENT -->
84-
## Automatically generated comment ℹ️
85-
**This comment is automatically generated and will be overwritten every time changes are committed to this branch.**
92+
## 👓 Previews for changed content
93+
**This comment is 🤖 automatically generated and will be overwritten every time changes are committed to this branch.**
8694
87-
The table contains an overview of files in the `content` directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the `data` directory will not show up in this table.
95+
The table contains an overview of files in the `content` directory that have been changed in this pull request. It's provided to make it easy to review your changes on the review server. Please note that changes to the `data` directory will not show up in this table.
8896
8997
---
9098
@@ -93,7 +101,6 @@ jobs:
93101
${{ steps.changes.outputs.changesTable }}
94102
95103
---
96-
fpt: Free, Pro, Team
97-
ghec: GitHub Enterprise Cloud
98-
ghes: GitHub Enterprise Server
104+
Key: **fpt**: Free, Pro, Team; **ghec**: GitHub Enterprise Cloud; **ghes**: GitHub Enterprise Server
105+
_This table is posted from the [${{ github.workflow }}](https://github.com/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/content-changes-table-comment.yml) workflow._
99106
edit-mode: replace

.github/workflows/generate-code-scanning-query-lists.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
147147
git add data/reusables/code-scanning/codeql-query-tables
148148
git commit -m "Update CodeQL query tables"
149-
git push origin $branchname
149+
git push -u origin $branchname
150150
151151
echo "Creating pull request..."
152152
gh pr create \

.github/workflows/no-response.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
This PR has been automatically closed because there has been no response to
4747
to our request for more information from the original author. Please reach out
4848
if you have the information we requested, or open a [new issue](https://github.com/github/docs/issues/new/choose)
49-
to describing your changes. Then we can begin the review process.
49+
to describe your changes. Then we can begin the review process.
5050
5151
- name: Check out repo
5252
if: ${{ failure() }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Reviewers - Content Systems
2+
3+
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
4+
# **Why we have it**: So we can have reviewers automatically without getting open source notifications.
5+
# **Who does it impact**: Docs team.
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- 'contributing/content-*.md'
11+
- 'content/contributing/**.md'
12+
- .github/workflows/reviewers-content-systems.yml
13+
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
repository-projects: read
18+
19+
jobs:
20+
reviewers-content-systems:
21+
if: >-
22+
${{ github.repository == 'github/docs-internal' &&
23+
!github.event.pull_request.draft &&
24+
!contains(github.event.pull_request.labels.*.name, 'reviewers-content-systems') &&
25+
github.event.pull_request.head.ref != 'repo-sync' }}
26+
runs-on: ubuntu-latest
27+
env:
28+
PR: ${{ github.event.pull_request.html_url }}
29+
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
30+
31+
steps:
32+
- name: Check out repo
33+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
34+
35+
- name: Add content systems as a reviewer
36+
run: |
37+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
38+
if ! echo "$labels" | grep -q 'reviewers-content-systems'; then
39+
gh pr edit $PR --add-reviewer github/docs-content-systems
40+
gh pr edit $PR --add-label reviewers-content-systems
41+
fi
+19-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Add Dependabot Core Maintainers as Reviewers
1+
name: Reviewers - Dependabot
22

33
# **What it does**: Automatically add reviewers based on paths, for docs-internal and docs repos.
44
# **Why we have it**: So dependabot maintainers can be notified about relevant pull requests.
@@ -10,25 +10,33 @@ on:
1010
- 'data/reusable/dependabot/**'
1111
- 'content/code-security/dependabot/**'
1212
- 'content/rest/dependabot/**'
13+
- '.github/workflows/reviewers-dependabot.yml'
14+
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
repository-projects: read
1319

1420
jobs:
1521
add-reviewer:
16-
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
22+
if: >-
23+
${{ github.repository == 'github/docs-internal' &&
24+
!github.event.pull_request.draft &&
25+
!contains(github.event.pull_request.labels.*.name, 'reviewers-dependabot') &&
26+
github.event.pull_request.head.ref != 'repo-sync' }}
1727
runs-on: ubuntu-latest
28+
env:
29+
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
30+
PR: ${{ github.event.pull_request.html_url }}
31+
1832
steps:
1933
- name: Check out repo
2034
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2135

2236
- name: Add Dependabot Core Maintainers as reviewers
23-
env:
24-
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
25-
PR: ${{ github.event.pull_request.html_url }}
2637
run: |
27-
has_reviewer=$(
28-
gh pr view $PR --json reviews |
29-
jq 'any(.reviews[]; select(length > 0))'
30-
)
31-
if ! $has_reviewer
32-
then
38+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
39+
if ! echo "$labels" | grep -q 'reviewers-dependabot'; then
3340
gh pr edit $PR --add-reviewer github/dependabot-updates-reviewers
41+
gh pr edit $PR --add-label reviewers-dependabot
3442
fi

.github/workflows/codeowners-docs-engineering.yml .github/workflows/reviewers-docs-engineering.yml

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Codeowners - Docs Engineering
1+
name: Reviewers - Docs Engineering
22

33
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
44
# And sets the 'engineering' label on the PR. It also edits the PR body to add a template
@@ -23,37 +23,36 @@ on:
2323
- '!src/**.json' # So that Docs Engineering isn't reviewing automated pipeline data PRs
2424
- '!src/**.yml' # So that Docs Engineering isn't reviewing automated pipeline data PRs
2525
- '.github/**'
26+
- 'config/**'
2627
- '**Dockerfile'
2728
- 'package*.json'
28-
- .github/workflows/codeowners-docs-engineering.yml
29+
- .github/workflows/reviewers-docs-engineering.yml
30+
31+
permissions:
32+
contents: read
33+
pull-requests: write
34+
repository-projects: read
2935

3036
jobs:
3137
codeowners-docs-engineering:
3238
if: >-
3339
${{ github.repository == 'github/docs-internal' &&
3440
!github.event.pull_request.draft &&
35-
!contains(github.event.pull_request.labels.*.name, 'engineering') &&
41+
!contains(github.event.pull_request.labels.*.name, 'reviewers-docs-engineering') &&
3642
github.event.pull_request.head.ref != 'repo-sync' }}
3743
runs-on: ubuntu-latest
3844
env:
39-
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
4045
PR: ${{ github.event.pull_request.html_url }}
46+
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
4147

4248
steps:
4349
- name: Check out repo
4450
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4551

46-
- name: Label as engineering
47-
run: gh pr edit $PR --add-label engineering
48-
49-
- name: Add Docs Engineering as a reviewer
52+
- name: Add docs engineering as a reviewer
5053
run: |
51-
needs_review=$(
52-
gh pr view $PR --json reviews |
53-
jq '.reviews |
54-
length == 0 or all(.author.login == "${{github.event.pull_request.user.login}}")'
55-
)
56-
if $needs_review
57-
then
54+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
55+
if ! echo "$labels" | grep -q 'reviewers-docs-engineering'; then
5856
gh pr edit $PR --add-reviewer github/docs-engineering
57+
gh pr edit $PR --add-label reviewers-docs-engineering
5958
fi

.github/workflows/codeowners-legal.yml .github/workflows/reviewers-legal.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Codeowners - Legal
1+
name: Reviewers - Legal
22

33
# **What it does**: Enforces reviews of Responsible AI (RAI) content by the GitHub legal team. Because RAI content can live anywhere in the content directory, it becomes a maintenance problem to use CODEOWNERS to enforce review on each article.
44
# **Why we have it**: RAI content must be reviewed by the GitHub legal team.
@@ -15,7 +15,7 @@ on:
1515
- synchronize
1616
paths:
1717
- 'content/**'
18-
- .github/workflows/codeowners-legal.yml
18+
- .github/workflows/reviewers-legal.yml
1919

2020
permissions:
2121
contents: read
@@ -27,6 +27,7 @@ jobs:
2727
if: >-
2828
${{ github.repository == 'github/docs-internal' &&
2929
!github.event.pull_request.draft &&
30+
!contains(github.event.pull_request.labels.*.name, 'reviewers-legal') &&
3031
github.event.pull_request.head.ref != 'repo-sync' }}
3132
runs-on: ubuntu-latest
3233
steps:
@@ -62,7 +63,7 @@ jobs:
6263
- name: Check for reviewers-legal label, add if missing and request review
6364
if: steps.checkContentType.outputs.containsContentType == 'true'
6465
env:
65-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
6667
PR: ${{ github.event.pull_request.html_url }}
6768
run: |
6869
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')

0 commit comments

Comments
 (0)