Skip to content

Commit 4af9686

Browse files
ci: fixed issue in notify (#82)
1 parent 79e1c52 commit 4af9686

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

.changeset/young-candles-smash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hai-build-code-generator": patch
3+
---
4+
5+
Removed random gif in notify for dev release

.github/workflows/release-dev.yml

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,17 @@ jobs:
9292
exit 1
9393
fi
9494
95-
# Fetch random celebration GIF
96-
RANDOM_GIF=$(curl -s "https://api.giphy.com/v1/gifs/random?api_key=0UTRbFtkMxAplrohufYco5IY74U8hOes&tag=celebration+sports&rating=g" | jq -r '.data.images.original.webp')
97-
9895
echo "Notifying release ${{ needs.initialize.outputs.package_name }}:${{ needs.initialize.outputs.build_version }}"
9996
97+
# Get commit details
98+
COMMIT_SHA=${{ github.sha }}
99+
COMMIT_SHORT_SHA=${COMMIT_SHA:0:7}
100+
101+
# Get commit message, author and timestamp (IST - UTC+5:30)
102+
COMMIT_MSG=$(git log -1 --pretty=format:"%s" $COMMIT_SHA)
103+
COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an" $COMMIT_SHA)
104+
TIMESTAMP=$(TZ=":Asia/Kolkata" date "+%d-%b-%Y %I:%M %p IST")
105+
100106
# Prepare the notification with UI components
101107
curl -X POST -H 'Content-type: application/json' --data "{
102108
\"type\": \"message\",
@@ -107,51 +113,32 @@ jobs:
107113
\"type\": \"AdaptiveCard\",
108114
\"version\": \"1.5\",
109115
\"body\": [
110-
{
111-
\"type\": \"ColumnSet\",
112-
\"columns\": [
113-
{
114-
\"type\": \"Column\",
115-
\"width\": \"auto\",
116-
\"items\": [
117-
{
118-
\"type\": \"Icon\",
119-
\"name\": \"Megaphone\",
120-
\"size\": \"xxSmall\",
121-
\"color\": \"Accent\",
122-
\"style\": \"Filled\"
123-
}
124-
]
125-
},
126-
{
127-
\"type\": \"Column\",
128-
\"width\": \"stretch\",
129-
\"items\": [
130-
{
131-
\"type\": \"TextBlock\",
132-
\"text\": \"Release Announcement\",
133-
\"size\": \"Small\",
134-
\"isSubtle\": true
135-
}
136-
]
137-
}
138-
]
139-
},
140116
{
141117
\"type\": \"TextBlock\",
142-
\"text\": \"Release - v${{ env.BUILD_VERSION }}\",
118+
\"text\": \"✅ Development Build Successfull\",
143119
\"weight\": \"Bolder\",
144120
\"size\": \"Medium\"
145121
},
146122
{
147-
\"type\": \"TextBlock\",
148-
\"text\": \"🎉 The latest release is now available!\",
149-
\"wrap\": true
150-
},
151-
{
152-
\"type\": \"Image\",
153-
\"url\": \"$RANDOM_GIF\",
154-
\"size\": \"Stretch\"
123+
\"type\": \"FactSet\",
124+
\"facts\": [
125+
{
126+
\"title\": \"Version\",
127+
\"value\": \"v${{ env.BUILD_VERSION }}\"
128+
},
129+
{
130+
\"title\": \"Built at\",
131+
\"value\": \"$TIMESTAMP\"
132+
},
133+
{
134+
\"title\": \"Commit\",
135+
\"value\": \"${COMMIT_SHORT_SHA} - ${COMMIT_MSG}\"
136+
},
137+
{
138+
\"title\": \"Author\",
139+
\"value\": \"$COMMIT_AUTHOR\"
140+
}
141+
]
155142
},
156143
{
157144
\"type\": \"ActionSet\",

0 commit comments

Comments
 (0)