wseg
This commit is contained in:
@@ -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 "{
|
||||
|
||||
Reference in New Issue
Block a user