Skip to content

Commit 6eabc7b

Browse files
author
UPM Auto Publisher Bot
committed
feat: add package details to Discord notifications
Show package name and version change (old → new) in Discord notifications. Changes: - Track published packages with old/new versions in published_packages.txt - Format package details as 'name: old → new' or 'name: version (new package)' - Replace 'Packages Published/Skipped' counters with detailed package list - Add summary field showing counts: 'Published: X | Skipped: Y'
1 parent 5061049 commit 6eabc7b

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/publish-upm.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ jobs:
452452
if [ "$published_version" = "$new_version" ]; then
453453
echo "✅ Verified: ${package_name}@${new_version} is available on registry"
454454
published=$((published + 1))
455+
456+
# Track package details for Discord notification
457+
echo "${package_name}|${latest_version}|${new_version}" >> published_packages.txt
455458
else
456459
echo "❌ Verification failed: Package not found on registry"
457460
echo " Expected: $new_version"
@@ -608,8 +611,19 @@ jobs:
608611
exit 0
609612
fi
610613
611-
# Build package list from audit log
612-
package_list=$(jq -r '.published' audit-log.json 2>/dev/null || echo "${{ env.published }}")
614+
# Build package details from tracking file
615+
if [ -f published_packages.txt ]; then
616+
package_details=$(cat published_packages.txt | while IFS='|' read -r name old_ver new_ver; do
617+
if [ "$old_ver" = "0.0.0" ]; then
618+
echo "• **$name**: \`$new_ver\` (new package)"
619+
else
620+
echo "• **$name**: \`$old_ver\` → \`$new_ver\`"
621+
fi
622+
done | tr '\n' '\n')
623+
else
624+
package_details="No package details available"
625+
fi
626+
613627
commit_msg=$(git log -1 --pretty=%s | head -c 200)
614628
commit_author=$(git log -1 --pretty='%an')
615629
workflow_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
@@ -626,6 +640,7 @@ jobs:
626640
--arg author "$commit_author" \
627641
--arg workflow_url "$workflow_url" \
628642
--arg registry "$registry_url" \
643+
--arg package_details "$package_details" \
629644
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
630645
'{
631646
"embeds": [{
@@ -634,14 +649,14 @@ jobs:
634649
"color": 3066993,
635650
"fields": [
636651
{
637-
"name": "📦 Packages Published",
638-
"value": ($published | tostring),
639-
"inline": true
652+
"name": "📦 Package Details",
653+
"value": $package_details,
654+
"inline": false
640655
},
641656
{
642-
"name": "⏭️ Packages Skipped",
643-
"value": ($skipped | tostring),
644-
"inline": true
657+
"name": "📊 Summary",
658+
"value": ("Published: **" + $published + "** | Skipped: **" + $skipped + "**"),
659+
"inline": false
645660
},
646661
{
647662
"name": "📁 Repository",

0 commit comments

Comments
 (0)