fix(ci): Validate子job末尾手动curl上报status,彻底解决act-runner长连接超时
CI Build & Deploy Pipeline / Build Staging API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (push) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Validate - DB Migrations (push) Successful in 30s
CI/CD Pipeline / Validate - DB Migrations (pull_request) Successful in 28s
CI/CD Pipeline / Frontend Lint (push) Successful in 1m12s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m17s
CI/CD Pipeline / Unit Tests (push) Successful in 4m49s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 4m40s
CI Build & Deploy Pipeline / Build Production API Image (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production Web Image (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production Worker Image (push) Has been cancelled
CI Build & Deploy Pipeline / Deploy Production (push) Has been cancelled
CI Build & Deploy Pipeline / Production Browser E2E (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Build Staging API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (push) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Validate - DB Migrations (push) Successful in 30s
CI/CD Pipeline / Validate - DB Migrations (pull_request) Successful in 28s
CI/CD Pipeline / Frontend Lint (push) Successful in 1m12s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m17s
CI/CD Pipeline / Unit Tests (push) Successful in 4m49s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 4m40s
CI Build & Deploy Pipeline / Build Production API Image (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production Web Image (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production Worker Image (push) Has been cancelled
CI Build & Deploy Pipeline / Deploy Production (push) Has been cancelled
CI Build & Deploy Pipeline / Production Browser E2E (push) Has been cancelled
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been cancelled
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
根因:act-runner v0.2.6与Gitea的长连接不稳定,job执行完后结果状态经常报不上来,导致status一直pending。 修复:两个Validate子job末尾都加上手动curl上报status,成功时在检查脚本末尾直接POST success,失败时通过Report failure步骤POST failure。绕过act-runner内置的上报机制。
This commit is contained in:
@@ -134,6 +134,27 @@ jobs:
|
||||
echo ""
|
||||
echo "🎉 All code quality checks passed!"
|
||||
|
||||
echo ""
|
||||
echo "=== Reporting success status to Gitea ==="
|
||||
STATUS_URL="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
|
||||
curl -s -X POST "$STATUS_URL" \
|
||||
-H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state":"success","context":"CI/CD Pipeline / Validate - Code Quality","description":"Code quality checks passed"}' > /dev/null 2>&1
|
||||
echo "Status reported successfully"
|
||||
|
||||
- name: Report failure to Gitea
|
||||
continue-on-error: true
|
||||
if: failure()
|
||||
shell: sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
echo "Reporting failure status to Gitea..."
|
||||
STATUS_URL="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
|
||||
curl -s -X POST "$STATUS_URL" -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/json" -d '{"state":"failure","context":"CI/CD Pipeline / Validate - Code Quality","description":"Code quality checks failed"}' > /dev/null 2>&1
|
||||
echo "Failure status reported"
|
||||
|
||||
- name: Notify on failure
|
||||
continue-on-error: true
|
||||
if: failure()
|
||||
|
||||
Reference in New Issue
Block a user