Update test.yaml #6
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: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# 其他步骤... | |
- name: Translate job status to Chinese | |
id: translate-status | |
run: | | |
if [ "${{ job.status }}" == "success" ]; then | |
echo "::set-output name=translated_status::成功" | |
elif [ "${{ job.status }}" == "failure" ]; then | |
echo "::set-output name=translated_status::失败" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
echo "::set-output name=translated_status::取消" | |
else | |
echo "::set-output name=translated_status::未知" | |
fi | |
- name: Notify job status | |
if: always() # 确保这一步始终运行,不管之前的步骤是否成功 | |
run: | | |
curl -X "POST" "https://api.day.app/a8BiVYYGe7sMfKWLBNNcCj" \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-d '{ | |
"body": "Github Acitions 运行'${{ steps.translate-status.outputs.translated_status }}'", | |
"title": "'${{ github.repository }}'", | |
"badge": 1, | |
"category": "Github Actions", | |
"sound": "multiwayinvitation.caf", | |
"icon": "https://cdn-icons-png.flaticon.com/512/25/25231.png", | |
"group": "Github Actions" | |
}' |