fix(ci): deploy-client 用 env 传 REF_NAME(防 Actions 注入)+ job.status 同法
Deploy Client / build-android (push) Successful in 1m38s
Deploy Client / build-windows (push) Failing after 6m27s
Deploy Client / release-deploy (push) Has been skipped

安全审查:run: 里内联 ${{ gitea.ref_name }} 有注入风险(恶意 tag 名);改经 env REF_NAME
+ 引用 "$REF_NAME"(同 deploy-server.yml 的 TAG 做法)。notify 的 job.status 同法。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
wangjia
2026-07-06 22:22:00 +08:00
parent 7d0f4c8065
commit 8c8486f9af
+14 -7
View File
@@ -45,7 +45,8 @@ jobs:
env:
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: bash scripts/ci/compile-android.sh "${{ gitea.ref_name }}"
REF_NAME: ${{ gitea.ref_name }}
run: bash scripts/ci/compile-android.sh "$REF_NAME"
- name: Upload android artifact
uses: actions/upload-artifact@v3
@@ -65,7 +66,9 @@ jobs:
- name: Compile (Windows installer)
shell: bash
run: bash scripts/ci/compile-windows.sh "${{ gitea.ref_name }}"
env:
REF_NAME: ${{ gitea.ref_name }}
run: bash scripts/ci/compile-windows.sh "$REF_NAME"
- name: Upload windows artifact
uses: actions/upload-artifact@v3
@@ -96,22 +99,26 @@ jobs:
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
run: bash scripts/ci/release-client.sh "${{ gitea.ref_name }}"
REF_NAME: ${{ gitea.ref_name }}
run: bash scripts/ci/release-client.sh "$REF_NAME"
- name: Deploy → pangolin1 (downloads/)
env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
run: bash scripts/ci/deploy-client.sh "${{ gitea.ref_name }}"
REF_NAME: ${{ gitea.ref_name }}
run: bash scripts/ci/deploy-client.sh "$REF_NAME"
- name: Notify
if: always()
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
REF_NAME: ${{ gitea.ref_name }}
JOB_STATUS: ${{ job.status }}
run: |
. scripts/ci/notify.sh
if [ "${{ job.status }}" = "success" ]; then
notify_ok "client ${{ gitea.ref_name }} released + deployed"
if [ "$JOB_STATUS" = "success" ]; then
notify_ok "client $REF_NAME released + deployed"
else
notify_fail "client ${{ gitea.ref_name }} pipeline failed"
notify_fail "client $REF_NAME pipeline failed"
fi