Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,25 @@ jobs:
--tag ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}

- name: qyweixin send message
if: ${{ env.QYWX_ROBOT_URL != '' }}
if: ${{ always() && env.QYWX_ROBOT_URL != '' }}
uses: chf007/action-wechat-work@master
env:
WECHAT_WORK_BOT_WEBHOOK: ${{secrets.QYWX_ROBOT_URL}}
IMAGE_URL: ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
with:
msgtype: markdown
content: |
# 镜像同步成功
# 镜像同步${{ job.status == 'success' && '成功' || '失败' }}
> 状态: ${{ job.status }}
```
${{ env.IMAGE_URL }}
```

- name: telegram send message
if: ${{ env.TELEGRAM_BOT_TOKEN != '' && env.TELEGRAM_CHAT_ID != '' }}
if: ${{ always() && env.TELEGRAM_BOT_TOKEN != '' && env.TELEGRAM_CHAT_ID != '' }}
env:
IMAGE_URL: ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
run: |
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="镜像同步成功: ${{ env.IMAGE_URL }}"
-d text="镜像同步${{ job.status == 'success' && '成功' || '失败' }} [${{ job.status }}]: ${{ env.IMAGE_URL }}"