From 5ff377223ad3b347648f1bd9014d0b9f3770810d Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 14 Feb 2026 11:58:22 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20logic=20to=20update?= =?UTF-8?q?=20PR=20comments=20and=20labels=20based=20on=20CI=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces new functionality that updates pull request comments and labels automatically based on the outcomes of continuous integration tests. This enhances the efficiency and visibility of the review process by providing immediate feedback directly within the PR interface. --- .gitea/workflows/pr-check.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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