1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Update other reviewers to avoid copilot reviewer (#54033)

This commit is contained in:
Kevin Heis
2025-01-21 11:13:03 -08:00
committed by GitHub
parent 88f15e4fea
commit 201f7f7a6b
5 changed files with 77 additions and 63 deletions

View File

@@ -1,34 +0,0 @@
name: Codeowners - Content Strategy
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
# **Why we have it**: So we can have reviewers automatically without getting open source notifications.
# **Who does it impact**: Docs team.
on:
pull_request:
paths:
- 'contributing/content-*.md'
- 'content/contributing/**.md'
- .github/workflows/codeowners-content-systems.yml
jobs:
codeowners-content-systems:
if: ${{ github.repository == 'github/docs-internal' }}
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Add Content Systems as a reviewer
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }}
run: |
has_reviewer=$(
gh pr view $PR --json reviews |
jq 'any(.reviews[]; select(length > 0))'
)
if ! $has_reviewer
then
gh pr edit $PR --add-reviewer github/docs-content-systems
fi

View File

@@ -0,0 +1,41 @@
name: Reviewers - Content Systems
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
# **Why we have it**: So we can have reviewers automatically without getting open source notifications.
# **Who does it impact**: Docs team.
on:
pull_request:
paths:
- 'contributing/content-*.md'
- 'content/contributing/**.md'
- .github/workflows/reviewers-content-systems.yml
permissions:
contents: read
pull-requests: write
repository-projects: read
jobs:
reviewers-content-systems:
if: >-
${{ github.repository == 'github/docs-internal' &&
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'reviewers-content-systems') &&
github.event.pull_request.head.ref != 'repo-sync' }}
runs-on: ubuntu-latest
env:
PR: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
steps:
- name: Check out repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Add content systems as a reviewer
run: |
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
if ! echo "$labels" | grep -q 'reviewers-content-systems'; then
gh pr edit $PR --add-reviewer github/docs-content-systems
gh pr edit $PR --add-label reviewers-content-systems
fi

View File

@@ -1,4 +1,4 @@
name: Add Dependabot Core Maintainers as Reviewers
name: Reviewers - Dependabot
# **What it does**: Automatically add reviewers based on paths, for docs-internal and docs repos.
# **Why we have it**: So dependabot maintainers can be notified about relevant pull requests.
@@ -10,25 +10,33 @@ on:
- 'data/reusable/dependabot/**'
- 'content/code-security/dependabot/**'
- 'content/rest/dependabot/**'
- '.github/workflows/reviewers-dependabot.yml'
permissions:
contents: read
pull-requests: write
repository-projects: read
jobs:
add-reviewer:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
if: >-
${{ github.repository == 'github/docs-internal' &&
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'reviewers-dependabot') &&
github.event.pull_request.head.ref != 'repo-sync' }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }}
steps:
- name: Check out repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Add Dependabot Core Maintainers as reviewers
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }}
run: |
has_reviewer=$(
gh pr view $PR --json reviews |
jq 'any(.reviews[]; select(length > 0))'
)
if ! $has_reviewer
then
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
if ! echo "$labels" | grep -q 'reviewers-dependabot'; then
gh pr edit $PR --add-reviewer github/dependabot-updates-reviewers
gh pr edit $PR --add-label reviewers-dependabot
fi

View File

@@ -1,4 +1,4 @@
name: Codeowners - Docs Engineering
name: Reviewers - Docs Engineering
# **What it does**: Automatically add reviewers based on paths, but only for the docs-internal repo.
# And sets the 'engineering' label on the PR. It also edits the PR body to add a template
@@ -25,35 +25,33 @@ on:
- '.github/**'
- '**Dockerfile'
- 'package*.json'
- .github/workflows/codeowners-docs-engineering.yml
- .github/workflows/reviewers-docs-engineering.yml
permissions:
contents: read
pull-requests: write
repository-projects: read
jobs:
codeowners-docs-engineering:
if: >-
${{ github.repository == 'github/docs-internal' &&
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'engineering') &&
!contains(github.event.pull_request.labels.*.name, 'reviewers-docs-engineering') &&
github.event.pull_request.head.ref != 'repo-sync' }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
steps:
- name: Check out repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Label as engineering
run: gh pr edit $PR --add-label engineering
- name: Add Docs Engineering as a reviewer
- name: Add docs engineering as a reviewer
run: |
needs_review=$(
gh pr view $PR --json reviews |
jq '.reviews |
length == 0 or all(.author.login == "${{github.event.pull_request.user.login}}")'
)
if $needs_review
then
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
if ! echo "$labels" | grep -q 'reviewers-docs-engineering'; then
gh pr edit $PR --add-reviewer github/docs-engineering
gh pr edit $PR --add-label reviewers-docs-engineering
fi

View File

@@ -1,4 +1,4 @@
name: Codeowners - Legal
name: Reviewers - Legal
# **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.
# **Why we have it**: RAI content must be reviewed by the GitHub legal team.
@@ -15,7 +15,7 @@ on:
- synchronize
paths:
- 'content/**'
- .github/workflows/codeowners-legal.yml
- .github/workflows/reviewers-legal.yml
permissions:
contents: read
@@ -27,6 +27,7 @@ jobs:
if: >-
${{ github.repository == 'github/docs-internal' &&
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'reviewers-legal') &&
github.event.pull_request.head.ref != 'repo-sync' }}
runs-on: ubuntu-latest
steps:
@@ -62,7 +63,7 @@ jobs:
- name: Check for reviewers-legal label, add if missing and request review
if: steps.checkContentType.outputs.containsContentType == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }}
run: |
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')