chore: fix table comment

This commit is contained in:
Scai 2025-01-08 00:34:49 +00:00
parent 1505c37e4c
commit 566305549f
1 changed files with 15 additions and 6 deletions

View File

@ -88,12 +88,21 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
# Markdown Table for Comment if [[ "${{ github.event_name }}" == "pull_request" ]]; then
COMMENT="✅ **Build successfully for ${{ github.event.pull_request.title }}!**\n\n" TITLE="${{ github.event.pull_request.title }}"
COMMENT+="| Name | Link |\n" else
COMMENT+="|------|------|\n" TITLE="main branch"
COMMENT+="| 🔗 Debug Binary | [Download](${{ env.ARTIFACT_URL }}) |\n" fi
COMMENT+="| 🔗 Latest commit | [${{ env.LATEST_COMMIT }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) |"
COMMENT=$(cat << EOF
✅ **Build successfully for $TITLE!**
| Name | Link |
|------------------|----------------------------------------------------------------------|
| 🔗 Debug Binary | [Download](${{ env.ARTIFACT_URL }}) |
| 🔗 Latest commit | [${{ env.LATEST_COMMIT }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) |
EOF
)
# Post Comment # Post Comment
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT"