Skip to content

Commit ab351f1

Browse files
author
Jeremy Dai
authored
Update auto-update.yml (#55)
1 parent 5ad324c commit ab351f1

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

.github/workflows/auto-update.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,17 @@ jobs:
4848
env:
4949
ISSUE_BODY: ${{ github.event.issue.body }}
5050
run: |
51-
# Extract the repository URL from the issue body
52-
# The format will match our template structure
53-
REPO_URL=$(echo "$ISSUE_BODY" | grep -A 1 "GitHub Repository URL" | tail -n 1 | xargs)
51+
# Extract the repository URL from the structured template format
52+
# Look for the URL between "GitHub Repository URL" and "Description" sections
53+
REPO_URL=$(echo "$ISSUE_BODY" | sed -n '/GitHub Repository URL/,/Description/p' | grep "https://" | head -n 1 | xargs)
5454
55-
# If that fails, try alternative format
55+
# If that doesn't work, try a simpler approach as fallback
5656
if [ -z "$REPO_URL" ]; then
57-
REPO_URL=$(echo "$ISSUE_BODY" | grep -o "https://github.com[^ ]*" | head -n 1)
57+
REPO_URL=$(echo "$ISSUE_BODY" | grep -o "https://github.com[^ ]*" | head -n 1 | xargs)
5858
fi
5959
60-
# Clean up the URL (remove any trailing characters)
61-
REPO_URL=$(echo "$REPO_URL" | sed -E 's/[^[:alnum:]\/\.\:\-\_].*//g')
62-
63-
# Output the extracted values for debugging
64-
echo "Repository URL: $REPO_URL"
60+
# Make sure we have the full URL (no truncation)
61+
echo "Raw Repository URL: $REPO_URL"
6562
6663
# Set outputs for use in later steps
6764
echo "repo_url=$REPO_URL" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)