2525 uses : actions/setup-node@v4
2626 with :
2727 node-version : 18
28- cache : ' npm'
28+ cache : " npm"
2929
3030 - name : Install dependencies
3131 run : npm ci
6363 uses : actions/setup-node@v4
6464 with :
6565 node-version : 18
66- cache : ' npm'
66+ cache : " npm"
6767
6868 - name : Install dependencies
6969 run : npm ci
9494 uses : actions/setup-node@v4
9595 with :
9696 node-version : 18
97- cache : ' npm'
97+ cache : " npm"
9898
9999 - name : Install dependencies
100100 run : npm ci
@@ -120,8 +120,11 @@ jobs:
120120 uses : actions/checkout@v4
121121 with :
122122 fetch-depth : 0
123-
123+
124124 - name : Send Telegram notification
125+ env :
126+ TELEGRAM_BOT_TOKEN : ${{ secrets.TELEGRAM_BOT_TOKEN }}
127+ TELEGRAM_CHAT_ID : ${{ secrets.TELEGRAM_CHAT_ID }}
125128 run : |
126129 if [ "${IS_ACT}" = "true" ]; then
127130 TEST_RESULT="success"
@@ -132,7 +135,7 @@ jobs:
132135 RELEASE_RESULT="${{ needs.release.result }}"
133136 DEPLOY_RESULT="${{ needs.deploy.result }}"
134137 fi
135-
138+
136139 STATUS="✅ *Pipeline completed successfully*"
137140 if [ "$TEST_RESULT" != "success" ]; then
138141 STATUS="❌ *Tests failed*"
@@ -141,22 +144,26 @@ jobs:
141144 elif [ "$DEPLOY_RESULT" != "success" ]; then
142145 STATUS="❌ *Deploy failed*"
143146 fi
144-
145- VERSION=$(git describe --tags --abbrev=0 2>/dev/null || git rev-parse --short HEAD)
147+
148+ VERSION=$(git tag --points-at HEAD)
149+ if [ -z "$VERSION" ]; then
150+ VERSION=$(git rev-parse --short HEAD)
151+ fi
152+
146153 BRANCH=$(git rev-parse --abbrev-ref HEAD)
147154 COMMIT=$(git rev-parse --short HEAD)
148155 REPO_URL="https://github.com/$GITHUB_REPOSITORY"
149156 LAST_AUTHOR=$(git log -1 --pretty=format:'%an')
150-
151- MESSAGE="$STATUS
152- 🕓 *Date:* $(date)
153- 🏷️ *Version/Tag:* $VERSION
154- 🌿 *Branch:* $BRANCH
155- 🔀 *Commit:* $COMMIT
156- 👤 *Author:* $LAST_AUTHOR
157+
158+ MESSAGE="$STATUS
159+ 🕓 *Date:* $(date)
160+ 🏷️ *Version/Tag:* $VERSION
161+ 🌿 *Branch:* $BRANCH
162+ 🔀 *Commit:* $COMMIT
163+ 👤 *Author:* $LAST_AUTHOR
157164 🔗 *Repo:* $REPO_URL"
158-
159- curl -s -X POST "https://api.telegram.org/bot${{ secrets. TELEGRAM_BOT_TOKEN } }/sendMessage" \
160- -d " chat_id=${{ secrets. TELEGRAM_CHAT_ID } }" \
161- -d " text=$( "$MESSAGE" \
162- -d " parse_mode=Markdown"
165+
166+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
167+ -d chat_id="${ TELEGRAM_CHAT_ID}" \
168+ -d text="$MESSAGE" \
169+ -d parse_mode=Markdown
0 commit comments