diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2bc31cc..24635fb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,29 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Extract PR Description + id: extract + run: | + BODY="${{ github.event.pull_request.body }}" + # Extract from '# Releases' onward + RELEASE_NOTES=$(echo "$BODY" | awk '/^# Releases/{flag=1} flag') + # Save it to an environment variable + echo "RELEASE_NOTES<> $GITHUB_ENV + echo "$RELEASE_NOTES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Send Telegram Message + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + 🚀 New Changeset PR Created + 🔗 PR: ${{ github.event.pull_request.html_url }} + 👤 Author: ${{ github.actor }} + 📦 Release Notes: + ${{ env.RELEASE_NOTES }} - name: "🔧 setup pnpm" uses: pnpm/action-setup@v3 @@ -59,18 +82,6 @@ jobs: with: path: .vitepress/dist - - name: send telegram message on push - uses: appleboy/telegram-action@master - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - message: | - ${{ github.actor }} created commit: - Commit message: ${{ github.event.commits[0].message }} - - Repository: ${{ github.repository }} - - See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} deploy: environment: