Skip to content

Tue May 28 16:38:22 2024 #11

Tue May 28 16:38:22 2024

Tue May 28 16:38:22 2024 #11

Workflow file for this run

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' }}
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>${{ github.event.head_commit.message }}"}}'
if: ${{ github.event_name == 'pull_request' }}

Check failure on line 31 in .github/workflows/dingtalk.yml

View workflow run for this annotation

GitHub Actions / Run DingTalk Robot and Send Message

Invalid workflow file

The workflow is not valid. .github/workflows/dingtalk.yml (Line: 31, Col: 7): 'if' is already defined .github/workflows/dingtalk.yml (Line: 32, Col: 7): 'run' is already defined
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>${{ github.event.pull_request.title }}"}}'