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

Revert "Improve conditional in Codeowners Legal check workflow" (#53496)

This commit is contained in:
Roniece Ricardo
2024-12-06 10:32:33 -05:00
committed by GitHub
parent c7404ec9b7
commit ab2bf47151

View File

@@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# 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
# fetch deeper history. But if it needs to, it will.
fetch-depth: 10
@@ -58,14 +58,19 @@ jobs:
CHANGED_FILE_PATHS: ${{ steps.changed-files.outputs.all_changed_files }}
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'
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 }}
run: |
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
if ! echo "$labels" | grep -q 'reviewers-legal'; then
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/legal-product
gh pr edit $PR --add-label reviewers-legal
fi