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

Fix DIY docs script (#54910)

This commit is contained in:
Joe Clark
2025-03-19 10:35:14 -07:00
committed by GitHub
parent 737c94aa53
commit 383943bb52

View File

@@ -49,20 +49,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
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
for ISSUE_NUM in $ISSUE_NUMS; do
# 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 "")
# Fetch labels only if the issue exists in the docs-content repository
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 gh issue view $ISSUE_NUM --repo github/docs-content --json labels > /dev/null 2>&1; then
# Fetch labels for the issue
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name' || echo "")
if echo "$LABELS" | grep -q 'DIY docs'; then
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
break
fi
else
echo "Issue $ISSUE_NUM does not exist in the docs-content repository."
fi
done
else