diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index c871d2690..9970ab20b 100755 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -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()