diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67f5c34..4d4f16c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,5 +81,4 @@ jobs: artifact: "specs" path: "openapi-good.json" upload_to_bucket: false - fail_threshold: warn - + fail_threshold: warn \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2f8a010..c4ff6cd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -172,13 +172,17 @@ jobs: METADATA="{\"repository\": \"$REPO_NAME\"}" echo "Publishing spec: $GHA_API_PATH" - - curl --fail-with-body -sS \ + + RESPONSE=$(curl --fail-with-body -sS \ -X PUT \ -H "Authorization: Bearer $ID_TOKEN" \ -F "metadata=$METADATA;type=application/json" \ -F "spec=@/tmp/specs/$filename" \ - "$CLOUD_RUN_ENDPOINT" - + "$CLOUD_RUN_ENDPOINT") || { + DETAIL=$(echo "$RESPONSE" | jq -r '.detail') + echo "::error file=$GHA_API_PATH,line=1::$DETAIL" + exit 1 + } + echo "Successfully published: $GHA_API_PATH" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index e5539c9..b84d102 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -143,12 +143,17 @@ jobs: METADATA="{\"repository\": \"$REPO_NAME\"}" echo "Uploading to api-spec-registry with dryRun=true..." - curl --fail-with-body -sS \ + + RESPONSE=$(curl --fail-with-body -sS \ -X PUT \ -H "Authorization: Bearer $ID_TOKEN" \ -F "metadata=$METADATA;type=application/json" \ -F "spec=@/tmp/specs/$filename" \ - "$CLOUD_RUN_ENDPOINT?dryRun=true" + "$CLOUD_RUN_ENDPOINT?dryRun=true") || { + DETAIL=$(echo "$RESPONSE" | jq -r '.detail') + echo "::error file=$GHA_API_PATH,line=1::$DETAIL" + exit 1 + } echo "Successfully validated: $GHA_API_PATH"