From 726c76d99803f244bc226a22418d35dad11178b2 Mon Sep 17 00:00:00 2001 From: Yuri Tseretyan Date: Wed, 13 Aug 2025 09:53:13 -0400 Subject: [PATCH] Improve workflow "Update Alerting Module" (#109565) * fix url to pull requests * add default labels * send message to slack --- .github/workflows/alerting-update-module.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alerting-update-module.yml b/.github/workflows/alerting-update-module.yml index 0b8d5730618..ea7e5d27e22 100644 --- a/.github/workflows/alerting-update-module.yml +++ b/.github/workflows/alerting-update-module.yml @@ -51,7 +51,7 @@ jobs: run: | TO_COMMIT="$(gh api repos/grafana/alerting/commits/"$BRANCH" --jq '.sha')" if [ -z "$TO_COMMIT" ]; then - echo "Branch $BRANCH not found in alerting repo, falling back to main branch" + echo "Branch $BRANCH not found in alerting repo" exit 1 fi echo "to_commit=$TO_COMMIT" >> "$GITHUB_OUTPUT" @@ -85,7 +85,7 @@ jobs: printf "%s\n" "$ALERTING_COMMITS" # make the list for markdown and replace PR numbers with links - ALERTING_COMMITS_FORMATTED="$(echo "$ALERTING_COMMITS" | while read -r line; do echo "- $line" | sed -E 's/\(#([0-9]+)\)/[#\1](https:\/\/github.com\/grafana\/grafana\/pull\/\1)/g'; done)" + ALERTING_COMMITS_FORMATTED="$(echo "$ALERTING_COMMITS" | while read -r line; do echo "- $line" | sed -E 's/\(#([0-9]+)\)/[#\1](https:\/\/github.com\/grafana\/alerting\/pull\/\1)/g'; done)" { echo "alerting_commits<> "$GITHUB_STEP_SUMMARY" + - name: Send Slack Message + uses: grafana/shared-workflows/actions/send-slack-message@send-slack-message/v2.0.3 + with: + method: 'chat.postMessage' + # send to alerting-reviews channel + payload-templated: true + payload: | + { + "channel": "C076RNRRZ2N", + "text": "Update alerting module in Grafana ${{ steps.create-pr.outputs.pull-request-url }}" + } \ No newline at end of file