Skip to content

Update main.yml

Update main.yml #9

Workflow file for this run

name: Test Telegram Notification
on:
push:
branches:
- main
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate comparison
- name: Shorten SHA
id: shorten_sha
run: echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Send Telegram Notification
uses: appleboy/[email protected]
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_API_KEY }}
format: html
disable_web_page_preview: true
message: |
🚀 <a href="https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.event.after }}">1 new commit</a> to <b>Learn-Linux</b>:main:
#️⃣ <b>Commit</b>: <a href="https://github.com/${{ github.repository }}/commit/${{ github.event.after }}">${{ steps.shorten_sha.outputs.sha_short }}</a>
📜 <b>Message</b>: ${{ github.event.head_commit.message }}
👤 <b>Author</b>: ${{ github.event.head_commit.author.name }}
🌿 <b>Branch</b>: ${{ github.ref_name }}
🔗 <b>Repo</b>: <a href="https://github.com/${{ github.repository }}">Browse Repository</a>
✨ <code>- by wired 2.1</code>