Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHR #37035

Closed
wants to merge 1 commit into from
Closed

DHR #37035

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/ready-for-doc-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,31 @@ jobs:
run: |
echo "Extracting issue numbers from PR description..."

# Get issue numbers directly using gh pr view
ISSUE_NUMS=$(gh pr view ${{ github.event.pull_request.number }} --json body -q .body | \
grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|github/docs-content#[0-9]+|#[0-9]+)' | \
grep -oE '[0-9]+$' || echo "")
echo "Extracted docs-content issue numbers: $ISSUE_NUMS"
# Clean up PR description to avoid syntax errors in grep command
PR_BODY="${{ github.event.pull_request.body }}"
echo "PR description to use in the script: $PR_BODY"

ISSUE_NUMS=$(echo "$PR_BODY" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|github/docs-content#[0-9]+|#[0-9]+)' | grep -oE '[0-9]+$')
echo "Extracted issue numbers: $ISSUE_NUMS"

if [ -n "$ISSUE_NUMS" ]; then
for ISSUE_NUM in $ISSUE_NUMS; do
echo "Checking issue #$ISSUE_NUM in the docs-content repository..."
if gh issue view $ISSUE_NUM --repo github/docs-content --json labels -q '.labels[].name' | grep -q 'DIY docs'; then
echo "DIY docs label found for issue #$ISSUE_NUM."
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
break
# Check if the issue exists in the docs-content repository
echo "Checking issue $ISSUE_NUM in the docs-content repository..."
if gh issue view $ISSUE_NUM --repo github/docs-content --json labels > /dev/null 2>&1; then
echo "Issue $ISSUE_NUM exists in docs-content. Fetching labels..."
# Fetch labels for the issue
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' || echo "")
echo "Labels for issue $ISSUE_NUM: $LABELS"
if echo "$LABELS" | grep -q 'DIY docs'; then
echo "DIY docs label found for issue $ISSUE_NUM."
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
break
else
echo "DIY docs label not found for issue $ISSUE_NUM."
fi
else
echo "Issue #$ISSUE_NUM exists but does not have the DIY docs label."
echo "Issue $ISSUE_NUM does not exist in the docs-content repository."
fi
done
else
Expand Down
Loading