From 5848f47c0ebf8cebc4dd426d0fcb6643edfa637b Mon Sep 17 00:00:00 2001 From: moilanik Date: Sun, 14 Jun 2026 11:08:18 +0300 Subject: [PATCH] wseg --- .gitea/workflows/build_publish-artifact.yml | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_publish-artifact.yml b/.gitea/workflows/build_publish-artifact.yml index c1e0bd4..5f646b1 100644 --- a/.gitea/workflows/build_publish-artifact.yml +++ b/.gitea/workflows/build_publish-artifact.yml @@ -39,7 +39,15 @@ jobs: echo "version=$VERSION" >> "$GITHUB_OUTPUT" TAGS_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ - "$GITEA_API_URL/api/v1/repos/$GITHUB_REPOSITORY/tags") + "$GITEA_API_URL/api/v1/repos/${{ github.repository }}/tags" 2>&1) + CURL_EXIT=$? + + if [ "${CURL_EXIT}" != "0" ]; then + echo "ERROR: curl failed with exit code ${CURL_EXIT}" >&2 + echo "artifact_exists=false" >> "$GITHUB_OUTPUT" + exit ${CURL_EXIT} + fi + TAG=$(echo "$TAGS_JSON" | jq -r 'if type == "array" then .[] | select(.commit.sha == "'"$GITHUB_SHA"'") | .name else empty end' | head -1) if [ -n "$TAG" ]; then echo "artifact_exists=true" >> "$GITHUB_OUTPUT" @@ -48,6 +56,17 @@ jobs: echo "artifact_exists=false" >> "$GITHUB_OUTPUT" fi + - name: Report check status + if: always() + run: | + VERSION="${{ needs.check.outputs.version }}" + if [ "${{ steps.check.outcome }}" = "success" ]; then + bash scripts/report-status.sh success "Check version $VERSION" ci-check + else + bash scripts/report-status.sh failure "Check version $VERSION FAILED" ci-check + exit 1 + fi + quality-gate: needs: [check] if: needs.check.outputs.artifact_exists == 'false' @@ -165,7 +184,7 @@ jobs: run: | VERSION="${{ needs.check.outputs.version }}" HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ - "$GITEA_API_URL/api/v1/repos/$GITHUB_REPOSITORY/tags" \ + "$GITEA_API_URL/api/v1/repos/${{ github.repository }}/tags" \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{