Skip to content

Commit 1df2078

Browse files
committed
update
1 parent 1b7a483 commit 1df2078

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

.github/workflows/update-checker.yaml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,35 @@ jobs:
117117
git commit -m "chore(bot): update ${pkg_name} to ${new_ver}"
118118
git push origin "$branch"
119119
120-
# Extract additional metadata for PR body
121-
src_url=$(echo "$pkg_data" | jq -r '.src_url // empty' | head -1)
122-
homepage=$(echo "$pkg_data" | jq -r '.homepage // empty' | head -1)
123-
description=$(echo "$pkg_data" | jq -r '.description // empty')
120+
# Extract metadata from recipe file directly
121+
description=""
122+
homepage=""
123+
src_url=""
124+
125+
if [ -f "$recipe_path" ]; then
126+
# Get description (handle both simple string and map format)
127+
description=$(grep -A1 "^description:" "$recipe_path" | head -2 | tail -1 | sed 's/^[[:space:]]*//; s/^short:[[:space:]]*//; s/^"//; s/"$//' | head -c 200)
128+
if echo "$description" | grep -q "^description:"; then
129+
description=$(echo "$description" | sed 's/^description:[[:space:]]*//; s/^"//; s/"$//')
130+
fi
131+
132+
# Get homepage (first entry)
133+
homepage=$(grep -A1 "^homepage:" "$recipe_path" | grep "^\s*-" | head -1 | sed 's/^[[:space:]]*-[[:space:]]*//; s/^"//; s/"$//')
134+
135+
# Get src_url (first entry)
136+
src_url=$(grep -A1 "^src_url:" "$recipe_path" | grep "^\s*-" | head -1 | sed 's/^[[:space:]]*-[[:space:]]*//; s/^"//; s/"$//')
137+
fi
138+
139+
# Build links section only if we have links
140+
LINKS_SECTION=""
141+
if [ -n "$homepage" ]; then
142+
LINKS_SECTION="${LINKS_SECTION}
143+
- 🏠 [Homepage](${homepage})"
144+
fi
145+
if [ -n "$src_url" ]; then
146+
LINKS_SECTION="${LINKS_SECTION}
147+
- 📥 [Source](${src_url})"
148+
fi
124149
125150
# Build detailed PR body
126151
PR_BODY=$(cat << EOF
@@ -130,16 +155,15 @@ jobs:
130155
|-------|-------|
131156
| **Package** | \`${pkg_name}\` |
132157
| **Package ID** | \`${pkg_id}\` |
133-
| **Recipe** | \`${recipe_path}\` |
158+
| **Recipe** | [\`${recipe_path}\`](https://github.com/${{ github.repository }}/blob/${branch}/${recipe_path}) |
134159
| **Old Version** | \`${old_ver}\` |
135160
| **New Version** | \`${new_ver}\` |
136161
137162
### Description
138163
${description:-_No description available_}
139-
164+
${LINKS_SECTION:+
140165
### Links
141-
- ${homepage:+🏠 [Homepage](${homepage})}
142-
- ${src_url:+📥 [Source](${src_url})}
166+
${LINKS_SECTION}}
143167
144168
### Checklist
145169
- [ ] Version bump is correct

0 commit comments

Comments
 (0)