From acf622552d5faa80f3a66e5ab06c313d3b212f22 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:06:30 +0200 Subject: [PATCH 1/4] 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 10fef0839ccf1480db1fc984f9e5f8ab724874b0 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:20:59 +0200 Subject: [PATCH 2/4] 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 6e5a65faf085bb901012d1b084c21187ed065014 Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 14:29:10 +0200 Subject: [PATCH 3/4] 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 b7a4575b182700dcdcc2e94cb5be74985f548d4a Mon Sep 17 00:00:00 2001 From: Pieter Hoppenbrouwers Date: Thu, 9 Jul 2026 16:11:15 +0200 Subject: [PATCH 4/4] Use public-safe Slack notification --- .github/workflows/pr-slack-notification.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-slack-notification.yml b/.github/workflows/pr-slack-notification.yml index d922c12..4e6fb6b 100644 --- a/.github/workflows/pr-slack-notification.yml +++ b/.github/workflows/pr-slack-notification.yml @@ -11,14 +11,13 @@ 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 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"