Tue May 28 16:44:20 2024 #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run DingTalk Robot and Send Message | ||
on: [push,pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker environment | ||
env: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
SECRET: ${{ secrets.SECRET }} | ||
run: | | ||
docker run -d --name dingtalk-robot --restart=unless-stopped -p 8080:8080 \ | ||
-e ACCESS_TOKEN="$ACCESS_TOKEN" \ | ||
-e SECRET="$SECRET" \ | ||
-e LOG_LEVEL="info" \ | ||
jerryin/dingtalk-robot | ||
- name: Wait for DingTalk Robot to start | ||
run: | | ||
sleep 1s | ||
- name: Send message using DingTalk Robot | ||
if: ${{ github.event_name == 'push' }} | ||
env: | ||
BODY: ${{ github.event.head_commit.message }} | ||
else: ${{ github.event_name == 'pull_request' }} | ||
Check failure on line 31 in .github/workflows/dingtalk.yml GitHub Actions / Run DingTalk Robot and Send MessageInvalid workflow file
|
||
env: | ||
BODY: ${{ github.event.pull_request.title }} | ||
run: | | ||
curl -X POST 'http://localhost:8080/robot/send' -H 'Content-Type: application/json' -d '{"msgtype":"markdown","markdown":{"title":"${{ github.repository }}","text":"### ${{ github.repository }}\n#### ${{ github.event.pusher.name }}\n>$BODY"}}' |