diff --git a/.gitea/workflows/pr-check.yaml b/.gitea/workflows/pr-check.yaml index 3e2e308..ea46251 100644 --- a/.gitea/workflows/pr-check.yaml +++ b/.gitea/workflows/pr-check.yaml @@ -147,6 +147,12 @@ jobs: -H "Content-Type: application/json" \ -d "{\"body\":\"\n$COMMENT_BODY\"}" \ "$API/issues/$PR/comments/$EXISTING_COMMENT_ID" + else + curl -s -X POST \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/json" \ + -d "$COMMENT_PAYLOAD" \ + "$API/issues/$PR/comments" fi # Remove label if exists @@ -157,6 +163,16 @@ jobs: "$API/issues/$PR/labels/ci-failed" fi + # Add ci-pass if not present + if ! echo "$LABELS" | grep -q "^ci-pass$"; then + echo "Adding ci-pass label" + curl -s -X POST \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"labels":["ci-pass"]}' \ + "$API/issues/$PR/labels" + fi + # Reopen PR if closed PR_STATE=$(curl -s -H "Authorization: token $TOKEN" "$API/pulls/$PR" | jq -r '.state') if [ "$PR_STATE" = "closed" ]; then