From 6834547d460c574ac67e605fcbd4257ac8e4fa4f Mon Sep 17 00:00:00 2001 From: "sameerasw.com" Date: Tue, 7 Jul 2026 19:13:27 +0530 Subject: [PATCH 1/3] feat: Update notify detections --- .github/workflows/notify.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 618bdbfb7..5cf95aaf0 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -5,8 +5,8 @@ on: types: [published] issues: types: [opened, closed] - pull_request: - types: [opened, closed] + pull_request_target: + types: [opened, closed, reopened, synchronize] workflow_dispatch: jobs: @@ -63,7 +63,7 @@ jobs: echo "EOF" } >> "$GITHUB_OUTPUT" - elif [[ "$EVENT" == "pull_request" ]]; then + elif [[ "$EVENT" == "pull_request" || "$EVENT" == "pull_request_target" ]]; then ACTION="${{ github.event.action }}" [[ "$ACTION" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]] && STATUS="💜 MERGED PR" || STATUS="🔵 PR $ACTION" { From 482b9fe35548d22cde6f6be6695e6e58f331805f Mon Sep 17 00:00:00 2001 From: "sameerasw.com" Date: Tue, 7 Jul 2026 19:32:35 +0530 Subject: [PATCH 2/3] Update notify.yml to improve issue and PR notifications --- .github/workflows/notify.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 5cf95aaf0..16243c99a 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -6,7 +6,7 @@ on: issues: types: [opened, closed] pull_request_target: - types: [opened, closed, reopened, synchronize] + types: [opened, closed, reopened] workflow_dispatch: jobs: @@ -56,20 +56,22 @@ jobs: elif [[ "$EVENT" == "issues" ]]; then ACTION="${{ github.event.action }}" STATUS=$([[ "$ACTION" == "opened" ]] && echo "🟢 NEW ISSUE" || echo "🔴 CLOSED ISSUE") + SENDER="${{ github.event.sender.login }}" { echo "full_message<$STATUS: $REPO" - echo "Issue: ${{ github.event.issue.title }}" + echo "Issue: ${{ github.event.issue.title }} by @$SENDER" echo "EOF" } >> "$GITHUB_OUTPUT" elif [[ "$EVENT" == "pull_request" || "$EVENT" == "pull_request_target" ]]; then ACTION="${{ github.event.action }}" [[ "$ACTION" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]] && STATUS="💜 MERGED PR" || STATUS="🔵 PR $ACTION" + SENDER="${{ github.event.sender.login }}" { echo "full_message<$STATUS: $REPO" - echo "PR: ${{ github.event.pull_request.title }}" + echo "PR: ${{ github.event.pull_request.title }} by @$SENDER" echo "EOF" } >> "$GITHUB_OUTPUT" fi From 867ea24d1fd579c1c7de53b042d0e3d7e8fb321a Mon Sep 17 00:00:00 2001 From: "sameerasw.com" Date: Tue, 7 Jul 2026 19:37:49 +0530 Subject: [PATCH 3/3] fix: release notify --- .github/workflows/notify.yml | 39 ++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 16243c99a..5a972e49b 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -15,25 +15,36 @@ jobs: steps: - name: Gather and Clean Data id: info + env: + CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + TOPIC_ID: ${{ secrets.TELEGRAM_TOPIC_ID }} + RELEASE_BODY: ${{ github.event.release.body }} + RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_URL: ${{ github.event.release.html_url }} + ISSUE_TITLE: ${{ github.event.issue.title }} + ISSUE_URL: ${{ github.event.issue.html_url }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_MERGED: ${{ github.event.pull_request.merged }} + EVENT_ACTION: ${{ github.event.action }} + EVENT_SENDER: ${{ github.event.sender.login }} run: | - CHAT_ID="${{ secrets.TELEGRAM_CHAT_ID }}" - TOPIC_ID="${{ secrets.TELEGRAM_TOPIC_ID }}" echo "final_chat_id=${CHAT_ID:- -1001653455300}" >> $GITHUB_OUTPUT echo "final_topic_id=${TOPIC_ID:-71370}" >> $GITHUB_OUTPUT - REPO="${{ github.repository }}" - EVENT="${{ github.event_name }}" + REPO="$GITHUB_REPOSITORY" + EVENT="$GITHUB_EVENT_NAME" if [[ "$EVENT" == "release" || "$EVENT" == "workflow_dispatch" ]]; then if [[ "$EVENT" == "workflow_dispatch" ]]; then - DATA=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest) + DATA=$(curl -s https://api.github.com/repos/$REPO/releases/latest) RAW_BODY=$(echo "$DATA" | jq -r .body) TAG=$(echo "$DATA" | jq -r .tag_name) URL=$(echo "$DATA" | jq -r .html_url) else - RAW_BODY="${{ github.event.release.body }}" - TAG="${{ github.event.release.tag_name }}" - URL="${{ github.event.release.html_url }}" + RAW_BODY="$RELEASE_BODY" + TAG="$RELEASE_TAG" + URL="$RELEASE_URL" fi CLEAN_BODY=$(echo "$RAW_BODY" | \ @@ -54,24 +65,22 @@ jobs: } >> "$GITHUB_OUTPUT" elif [[ "$EVENT" == "issues" ]]; then - ACTION="${{ github.event.action }}" + ACTION="$EVENT_ACTION" STATUS=$([[ "$ACTION" == "opened" ]] && echo "🟢 NEW ISSUE" || echo "🔴 CLOSED ISSUE") - SENDER="${{ github.event.sender.login }}" { echo "full_message<$STATUS: $REPO" - echo "Issue: ${{ github.event.issue.title }} by @$SENDER" + echo "Issue: $ISSUE_TITLE by @$EVENT_SENDER" echo "EOF" } >> "$GITHUB_OUTPUT" elif [[ "$EVENT" == "pull_request" || "$EVENT" == "pull_request_target" ]]; then - ACTION="${{ github.event.action }}" - [[ "$ACTION" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]] && STATUS="💜 MERGED PR" || STATUS="🔵 PR $ACTION" - SENDER="${{ github.event.sender.login }}" + ACTION="$EVENT_ACTION" + [[ "$ACTION" == "closed" && "$PR_MERGED" == "true" ]] && STATUS="💜 MERGED PR" || STATUS="🔵 PR $ACTION" { echo "full_message<$STATUS: $REPO" - echo "PR: ${{ github.event.pull_request.title }} by @$SENDER" + echo "PR: $PR_TITLE by @$EVENT_SENDER" echo "EOF" } >> "$GITHUB_OUTPUT" fi