Fix DIY docs script (#54910)
This commit is contained in:
12
.github/workflows/ready-for-doc-review.yml
vendored
12
.github/workflows/ready-for-doc-review.yml
vendored
@@ -49,20 +49,20 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
|
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
|
||||||
run: |
|
run: |
|
||||||
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|github/docs-content#[0-9]+|#[0-9]+)' | grep -oE '^[0-9]+$')
|
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|github/docs-content#[0-9]+|#[0-9]+)' | grep -oE '[0-9]+$')
|
||||||
|
|
||||||
if [ -n "$ISSUE_NUMS" ]; then
|
if [ -n "$ISSUE_NUMS" ]; then
|
||||||
for ISSUE_NUM in $ISSUE_NUMS; do
|
for ISSUE_NUM in $ISSUE_NUMS; do
|
||||||
# Check if the issue exists in the docs-content repository
|
# Check if the issue exists in the docs-content repository
|
||||||
ISSUE_REPO=$(gh issue view $ISSUE_NUM --repo github/docs-content --json repository --jq '.repository.name' 2>/dev/null || echo "")
|
if gh issue view $ISSUE_NUM --repo github/docs-content --json labels > /dev/null 2>&1; then
|
||||||
|
# Fetch labels for the issue
|
||||||
# Fetch labels only if the issue exists in the docs-content repository
|
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' || echo "")
|
||||||
if [ "$ISSUE_REPO" == "docs-content" ]; then
|
|
||||||
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' 2>/dev/null || echo "")
|
|
||||||
if echo "$LABELS" | grep -q 'DIY docs'; then
|
if echo "$LABELS" | grep -q 'DIY docs'; then
|
||||||
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
|
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Issue $ISSUE_NUM does not exist in the docs-content repository."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user