Skip to content

Typo: config.yml not _config.yml #1160

Typo: config.yml not _config.yml

Typo: config.yml not _config.yml #1160

name: Auto-add ready-for-doc-review label
# **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.
# **Why we have it**: To ensure DIY docs PRs are automatically added to the docs-content review board without requiring manual labeling.
# **Who does it impact**: Contributors making content changes and docs-content reviewers.
on:
pull_request:
types:
- opened
- ready_for_review
paths:
- 'content/**'
- 'data/**'
permissions:
contents: read
pull-requests: write
jobs:
add-review-label:
name: Add ready-for-doc-review label to DIY docs PRs
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.actor != 'github-openapi-bot' && github.actor != 'docs-bot'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
- name: Check team membership
id: membership_check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
try {
await github.rest.teams.getMembershipForUserInOrg({
org: 'github',
team_slug: 'docs',
username: context.payload.sender.login,
});
return true
} catch(err) {
console.log(err)
return false
}
- name: Add ready-for-doc-review label
if: steps.membership_check.outputs.result == 'false'
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit $PR_URL --add-label ready-for-doc-review