Revert "Improve conditional in Codeowners Legal check workflow" (#53496)
This commit is contained in:
17
.github/workflows/codeowners-legal.yml
vendored
17
.github/workflows/codeowners-legal.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
# Picking this number is a "best guess". If we make it too large,
|
# Picking this number is a "best guess". If we make it too large,
|
||||||
# the checkout will take potentially unnecessarily long.
|
# the checkout will take potentially unnecessariily long.
|
||||||
# This reduces the chance that tj-actions/changed-files has to
|
# This reduces the chance that tj-actions/changed-files has to
|
||||||
# fetch deeper history. But if it needs to, it will.
|
# fetch deeper history. But if it needs to, it will.
|
||||||
fetch-depth: 10
|
fetch-depth: 10
|
||||||
@@ -58,14 +58,19 @@ jobs:
|
|||||||
CHANGED_FILE_PATHS: ${{ steps.changed-files.outputs.all_changed_files }}
|
CHANGED_FILE_PATHS: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
CONTENT_TYPE: 'rai'
|
CONTENT_TYPE: 'rai'
|
||||||
|
|
||||||
- name: Check for reviewers-legal label, add if missing and request review
|
- name: Add Legal team as a reviewer
|
||||||
if: steps.checkContentType.outputs.containsContentType == 'true'
|
if: steps.checkContentType.outputs.containsContentType == 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# The GH CLI uses a slightly different env name for
|
||||||
|
# the token than the GITHUB_TOKEN used by actions
|
||||||
|
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
|
||||||
PR: ${{ github.event.pull_request.html_url }}
|
PR: ${{ github.event.pull_request.html_url }}
|
||||||
run: |
|
run: |
|
||||||
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
|
has_reviewer=$(
|
||||||
if ! echo "$labels" | grep -q 'reviewers-legal'; then
|
gh pr view $PR --json reviews |
|
||||||
|
jq 'any(.reviews[]; select(length > 0))'
|
||||||
|
)
|
||||||
|
if ! $has_reviewer
|
||||||
|
then
|
||||||
gh pr edit $PR --add-reviewer github/legal-product
|
gh pr edit $PR --add-reviewer github/legal-product
|
||||||
gh pr edit $PR --add-label reviewers-legal
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user