Skip to content

Commit

Permalink
fix: ci notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlutermade committed Sep 21, 2023
1 parent a55e9b6 commit 565a93d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,24 @@ jobs:
echo "content=[{\"title\": \"Main Has New Commit\", \"url\": \"https://github.com/${{ github.repository }}\", \"description\": \"## Main updated Please pull the latest commit\",\"fields\": [{\"name\": \"Commit Message\", \"value\": $ESCAPED_COMMIT_MESSAGE }, {\"name\": \"Owner\", \"value\": \"${{ github.event.head_commit.author.username }}\"}, {\"name\": \"Trigger Actor\", \"value\": \"${{ github.triggering_actor }}\"}, {\"name\": \"Status\", \"value\": \"${{ needs.check.result == 'failure' && 'Failure' || 'Success' }}\"}], \"footer\": {\"text\": \"created at ${{ github.event.head_commit.timestamp }}\"}}]" >> $GITHUB_OUTPUT
- name: No Message CONTENT
id: no_message_CONTENT
if: always()
run: |
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
ESCAPED_COMMIT_MESSAGE=$(echo "$COMMIT_MESSAGE" | jq -s -R -r @json)
echo "content=[{\"title\": \"Main Has New Commit\", \"url\": \"https://github.com/${{ github.repository }}\", \"description\": \"## Main updated Please pull the latest commit\",\"fields\": [{\"name\": \"Commit Message\", \"value\": \" the message not display \" }, {\"name\": \"Owner\", \"value\": \"${{ github.event.head_commit.author.username }}\"}, {\"name\": \"Trigger Actor\", \"value\": \"${{ github.triggering_actor }}\"}, {\"name\": \"Status\", \"value\": \"${{ needs.check.result == 'failure' && 'Failure' || 'Success' }}\"}], \"footer\": {\"text\": \"created at ${{ github.event.head_commit.timestamp }}\"}}]" >> $GITHUB_OUTPUT
- run: |
echo ${{ steps.CONTENT.outputs.content }}
- name: Can Review PR
if: always()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: GitHub Actions
DISCORD_AVATAR: https://avatars.githubusercontent.com/u/44036562?s=200&v=4
DISCORD_EMBEDS: ${{ steps.CONTENT.outputs.content }}
DISCORD_EMBEDS: ${{ steps.CONTENT.outputs.content || steps.CONTENT.outputs.content }}
uses: Ilshidur/action-discord@master
with:
args: ""

0 comments on commit 565a93d

Please sign in to comment.