Skip to content

add createRound

add createRound #180

Workflow file for this run

name: 👷 Main
on:
push:
branches: [main]
jobs:
check:
uses: ./.github/workflows/check.yml
secrets: inherit
notify:
needs: check
if: always()
runs-on: ubuntu-latest
steps:
- name: Set Timezone to Taipei
run: sudo ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
- name: Output CONTENT
id: CONTENT
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\": $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 || steps.CONTENT.outputs.content }}
uses: Ilshidur/action-discord@master
with:
args: ""