From 9944bf816bedcd70d85ca819cbc77440e5fce879 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:06:30 +0200 Subject: [PATCH 1/5] Add Slack PR notification --- .github/workflows/pr-slack-notification.yml | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pr-slack-notification.yml diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml new file mode 100644 index 0000000..b5c4de0 --- /dev/null +++ b/.github/workflows/pr-slack-notification.yml @@ -0,0 +1,31 @@ +name: Slack notification + +on: + pull_request: + types: [opened, reopened, ready_for_review] + +permissions: + contents: read + +jobs: + notify-slack: + name: Send + if: ${{ !github.event.pull_request.draft }} + runs-on: hetzner + timeout-minutes: 5 + steps: + - name: Send PR link + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TECH_WEBHOOK_URL }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: | + if [ -z "$SLACK_WEBHOOK_URL" ]; then + echo "SLACK_TECH_WEBHOOK_URL is not configured; skipping Slack notification." + exit 0 + fi + + curl --fail --silent --show-error \ + -X POST \ + -H 'Content-type: application/json' \ + --data "$(jq -n --arg text "$PR_URL" '{text: $text}')" \ + "$SLACK_WEBHOOK_URL" From def2bc71c8c214be697c5190ba6a45bfb1cb5833 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:20:59 +0200 Subject: [PATCH 2/5] Update Slack PR message --- .github/workflows/pr-slack-notification.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml index b5c4de0..459f52d 100644 --- a/.github/workflows/pr-slack-notification.yml +++ b/.github/workflows/pr-slack-notification.yml @@ -17,6 +17,8 @@ jobs: - name: Send PR link env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TECH_WEBHOOK_URL }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_NUMBER: ${{ github.event.pull_request.number }} PR_URL: ${{ github.event.pull_request.html_url }} run: | if [ -z "$SLACK_WEBHOOK_URL" ]; then @@ -27,5 +29,9 @@ jobs: curl --fail --silent --show-error \ -X POST \ -H 'Content-type: application/json' \ - --data "$(jq -n --arg text "$PR_URL" '{text: $text}')" \ + --data "$(jq -n \ + --arg title "$PR_TITLE" \ + --arg number "$PR_NUMBER" \ + --arg url "$PR_URL" \ + '{text: ("New PR: <" + $url + "|" + $title + " (#" + $number + ")>")}')" \ "$SLACK_WEBHOOK_URL" From 5189e296a52dce4441c3df788dfe1754cdef29f8 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:29:10 +0200 Subject: [PATCH 3/5] Update Slack PR message --- .github/workflows/pr-slack-notification.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml index 459f52d..d922c12 100644 --- a/.github/workflows/pr-slack-notification.yml +++ b/.github/workflows/pr-slack-notification.yml @@ -17,8 +17,10 @@ jobs: - name: Send PR link env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TECH_WEBHOOK_URL }} + PR_REPO: ${{ github.event.repository.name }} PR_TITLE: ${{ github.event.pull_request.title }} PR_NUMBER: ${{ github.event.pull_request.number }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_URL: ${{ github.event.pull_request.html_url }} run: | if [ -z "$SLACK_WEBHOOK_URL" ]; then @@ -30,8 +32,10 @@ jobs: -X POST \ -H 'Content-type: application/json' \ --data "$(jq -n \ + --arg repo "$PR_REPO" \ --arg title "$PR_TITLE" \ --arg number "$PR_NUMBER" \ + --arg author "$PR_AUTHOR" \ --arg url "$PR_URL" \ - '{text: ("New PR: <" + $url + "|" + $title + " (#" + $number + ")>")}')" \ + '{text: ("New " + $repo + " PR: <" + $url + "|" + $title + " (#" + $number + ")> by " + $author)}')" \ "$SLACK_WEBHOOK_URL" From c51a926d552b9e97b5c09e3402d4bc8223f058a8 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 15:36:22 +0200 Subject: [PATCH 4/5] Remove PR title from Slack message --- .github/workflows/pr-slack-notification.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml index d922c12..f7ee8ed 100644 --- a/.github/workflows/pr-slack-notification.yml +++ b/.github/workflows/pr-slack-notification.yml @@ -18,7 +18,6 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TECH_WEBHOOK_URL }} PR_REPO: ${{ github.event.repository.name }} - PR_TITLE: ${{ github.event.pull_request.title }} PR_NUMBER: ${{ github.event.pull_request.number }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_URL: ${{ github.event.pull_request.html_url }} @@ -33,9 +32,8 @@ jobs: -H 'Content-type: application/json' \ --data "$(jq -n \ --arg repo "$PR_REPO" \ - --arg title "$PR_TITLE" \ --arg number "$PR_NUMBER" \ --arg author "$PR_AUTHOR" \ --arg url "$PR_URL" \ - '{text: ("New " + $repo + " PR: <" + $url + "|" + $title + " (#" + $number + ")> by " + $author)}')" \ + '{text: ("New " + $repo + " PR: <" + $url + "|#" + $number + "> by " + $author)}')" \ "$SLACK_WEBHOOK_URL" From a2209c59e0ae23efd6acedd49ae76d64a0da0584 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 16:09:00 +0200 Subject: [PATCH 5/5] Use GitHub runner for Slack notification --- .github/workflows/pr-slack-notification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml index f7ee8ed..4e6fb6b 100644 --- a/.github/workflows/pr-slack-notification.yml +++ b/.github/workflows/pr-slack-notification.yml @@ -11,7 +11,7 @@ jobs: notify-slack: name: Send if: ${{ !github.event.pull_request.draft }} - runs-on: hetzner + runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Send PR link