Skip to content

test

test #132

Workflow file for this run

name: 👷 Main
on:
push:
branches: [main]
jobs:
check_lint:
uses: ./.github/workflows/checkLint.yml
secrets: inherit
check_type:
uses: ./.github/workflows/checkType.yml
secrets: inherit
unit_test:
uses: ./.github/workflows/unitTest.yml
secrets: inherit
notify:
needs: [check_lint, check_type, unit_test]
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 }}\"}, {\"name\": \"Trigger Actor\", \"value\": \"${{ github.triggering_actor }}\"}, {\"name\": \"Status\", \"value\": \"${{(needs.check_lint.result == 'failure' || needs.check_type.result == 'failure' || needs.unit_test.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
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 }}
uses: Ilshidur/action-discord@master
with:
args: ""