Skip to content

Commit 383943b

Browse files
authored
Fix DIY docs script (#54910)
1 parent 737c94a commit 383943b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/ready-for-doc-review.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ jobs:
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
5151
run: |
52-
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]+$')
52+
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]+$')
5353
5454
if [ -n "$ISSUE_NUMS" ]; then
5555
for ISSUE_NUM in $ISSUE_NUMS; do
5656
# Check if the issue exists in the docs-content repository
57-
ISSUE_REPO=$(gh issue view $ISSUE_NUM --repo github/docs-content --json repository --jq '.repository.name' 2>/dev/null || echo "")
58-
59-
# Fetch labels only if the issue exists in the docs-content repository
60-
if [ "$ISSUE_REPO" == "docs-content" ]; then
61-
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' 2>/dev/null || echo "")
57+
if gh issue view $ISSUE_NUM --repo github/docs-content --json labels > /dev/null 2>&1; then
58+
# Fetch labels for the issue
59+
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' || echo "")
6260
if echo "$LABELS" | grep -q 'DIY docs'; then
6361
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
6462
break
6563
fi
64+
else
65+
echo "Issue $ISSUE_NUM does not exist in the docs-content repository."
6666
fi
6767
done
6868
else

0 commit comments

Comments
 (0)