Skip to content

Commit b8433f1

Browse files
authored
Add engineering PRs to review board (#63604)
Copilot-Session: 03e47b55-eabf-42a3-86cc-8d79e869cb1f
1 parent a65084e commit b8433f1

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: Reviewers - Docs Engineering
1+
name: Add engineering PRs to review board
22

3-
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
4-
# And sets the 'engineering' label on the PR. It also edits the PR body to add a template
5-
# for asking questions for the sake of being confident about the PRs rollout.
6-
# **Why we have it**: So we can have reviewers automatically without getting open source notifications.
7-
# **Who does it impact**: Docs team.
3+
# Routes non-draft engineering PRs to the Docs & Blog Engineering PR Reviews board for triage.
4+
# Labels each PR, so later pushes skip board work unless the PR reopens.
85

96
on:
107
pull_request:
@@ -19,9 +16,9 @@ on:
1916
- '**.tsx'
2017
- '**.scss'
2118
- 'src/**'
22-
- '!src/**.json' # So that Docs Engineering isn't reviewing automated pipeline data PRs
23-
- '!src/**.yml' # So that Docs Engineering isn't reviewing automated pipeline data PRs
24-
- '!src/**.sha' # So that Docs Engineering isn't reviewing automated pipeline data PRs
19+
- '!src/**.json' # Docs Engineering does not triage automated pipeline data PRs.
20+
- '!src/**.yml' # Docs Engineering does not triage automated pipeline data PRs.
21+
- '!src/**.sha' # Docs Engineering does not triage automated pipeline data PRs.
2522
- '.github/**'
2623
- 'config/**'
2724
- '.devcontainer/**'
@@ -39,7 +36,8 @@ jobs:
3936
if: >-
4037
${{ github.repository == 'github/docs-internal' &&
4138
!github.event.pull_request.draft &&
42-
!contains(github.event.pull_request.labels.*.name, 'reviewers-docs-engineering') &&
39+
(github.event.action == 'reopened' ||
40+
!contains(github.event.pull_request.labels.*.name, 'reviewers-docs-engineering')) &&
4341
!contains(github.event.pull_request.labels.*.name, 'lockfile-churn-only') &&
4442
github.event.pull_request.head.ref != 'repo-sync' }}
4543
runs-on: ubuntu-latest
@@ -52,13 +50,13 @@ jobs:
5250

5351
# Detect PRs that only changed package-lock.json (no engineering source files).
5452
# These are usually cross-platform `npm install` churn from contributors
55-
# editing content. We comment with reset instructions instead of pulling in
56-
# docs-engineering for review.
53+
# editing content. We comment with reset instructions instead of adding
54+
# them to the engineering review board.
5755
#
5856
# Dependabot is exempt. Its security updates for transitive dependencies
5957
# change only the lockfile, because the dependency is not in package.json.
6058
# Those PRs are intentional, so the reset instructions are wrong and
61-
# suppressing the review request leaves them with no reviewer at all.
59+
# keeping them off the board leaves them without engineering triage.
6260
- name: Detect lockfile-only churn
6361
id: detect
6462
env:
@@ -97,15 +95,19 @@ jobs:
9795
git push
9896
```
9997
100-
If the lockfile change is intentional, remove the `lockfile-churn-only` label and request docs-engineering review.
98+
If the lockfile change is intentional, remove the `lockfile-churn-only` label and push or reopen the PR so this workflow sends it to the engineering review board.
10199
EOF
102100
gh pr comment "$PR" --body-file /tmp/lockfile-churn-body.md
103101
gh pr edit "$PR" --add-label lockfile-churn-only
104102
105-
- name: Add docs engineering as a reviewer
103+
- name: Add PR to board and label
106104
if: steps.detect.outputs.lockfile_only != 'true'
107105
env:
108106
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
107+
REPO: ${{ github.repository }}
108+
PR_NUMBER: ${{ github.event.pull_request.number }}
109109
uses: ./.github/actions/retry-command
110110
with:
111-
command: gh pr edit $PR --add-reviewer github/docs-engineering --add-label reviewers-docs-engineering
111+
command: >-
112+
gh project item-add 25672 --owner github --url "$PR" &&
113+
gh api "repos/$REPO/issues/$PR_NUMBER/labels" -f 'labels[]=reviewers-docs-engineering' --silent

0 commit comments

Comments
 (0)