[pull] main from github:main #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |