From 1efe53e6f04bffdd166694b750c87d0bda6787e4 Mon Sep 17 00:00:00 2001 From: Anubhab2003 Date: Tue, 21 Jan 2025 09:44:04 +0530 Subject: [PATCH] Clean up PR descriptions by removing comments --- .github/workflows/remove-pr-comments.yml | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/remove-pr-comments.yml diff --git a/.github/workflows/remove-pr-comments.yml b/.github/workflows/remove-pr-comments.yml new file mode 100644 index 0000000000..4344ffb694 --- /dev/null +++ b/.github/workflows/remove-pr-comments.yml @@ -0,0 +1,26 @@ +name: Remove PR Comments + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + remove-comments: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Remove commented content + id: remove_comments + run: | + PR_BODY=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") + CLEANED_BODY=$(echo "$PR_BODY" | sed '//d') + echo "cleaned_body=$CLEANED_BODY" >> $GITHUB_ENV + + - name: Update PR description + uses: peter-evans/repository-dispatch@v1 + with: + event-type: update-pr-description + client-payload: '{"body": "${{ env.cleaned_body }}"}'