From af7b77665a48515bbef4c7f30afbd3e956986ee2 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 20:49:48 -0500 Subject: [PATCH 01/12] feat: add notify workflow --- .github/workflows/notify.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 0000000..9522b47 --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,12 @@ +name: Notify with Slack +on: push +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send GitHub Action data to a Slack workflow + uses: slackapi/slack-github-action@v2.1.1 + with: + payload-delimiter: "_" + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: webhook-trigger From 29693656afce9ba1f9f57d30647552d0d0074044 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:11:23 -0500 Subject: [PATCH 02/12] sending data as a message with slack incomming webhook URL --- .github/workflows/notify.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 9522b47..c2da6bd 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -4,9 +4,17 @@ jobs: notify: runs-on: ubuntu-latest steps: - - name: Send GitHub Action data to a Slack workflow + - name: Post a message in a channel uses: slackapi/slack-github-action@v2.1.1 with: - payload-delimiter: "_" webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - webhook-type: webhook-trigger + webhook-type: incoming-webhook + payload: | + text: "*GitHub Action build result*: ${{ job.status }}\n + ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: "GitHub Action build result: ${{ job.status }}\n + ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" From 0624c350adac91c922ee709d6c8b82b3de826bf9 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:16:15 -0500 Subject: [PATCH 03/12] update notify message --- .github/workflows/notify.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index c2da6bd..28d1a88 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -10,11 +10,22 @@ jobs: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | - text: "*GitHub Action build result*: ${{ job.status }}\n - ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + payload: | + text: "Danny Torrence left a 1 star review for your property." blocks: - type: "section" text: type: "mrkdwn" - text: "GitHub Action build result: ${{ job.status }}\n - ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + text: "Danny Torrence left the following review for your property:" + - type: "section" + text: + type: "mrkdwn" + text: " :star: \n Doors had too many axe holes, guest in room 237 was far too rowdy, whole place felt stuck in the 1920s." + accessory: + type: "image" + image_url: "https://is5-ssl.mzstatic.com/image/thumb/Purple3/v4/d3/72/5c/d3725c8f-c642-5d69-1904-aa36e4297885/source/256x256bb.jpg" + alt_text: "Haunted hotel image" + - type: "section" + fields: + - type: "mrkdwn" + text: "*Average Rating*: 1.0" From b307b5b54da2ea12cf4feed9f2450a036b32ed40 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:18:37 -0500 Subject: [PATCH 04/12] update payload --- .github/workflows/notify.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 28d1a88..8a244f5 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -10,8 +10,7 @@ jobs: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | - payload: | - text: "Danny Torrence left a 1 star review for your property." + text: "Hello!!!!!!!!!!!" blocks: - type: "section" text: From d0556feae19b00c95b3fb1fd1e163698d6536ebd Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:34:49 -0500 Subject: [PATCH 05/12] update custom message --- .github/workflows/notify.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 8a244f5..58b8b62 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -15,16 +15,16 @@ jobs: - type: "section" text: type: "mrkdwn" - text: "Danny Torrence left the following review for your property:" - - type: "section" - text: - type: "mrkdwn" - text: " :star: \n Doors had too many axe holes, guest in room 237 was far too rowdy, whole place felt stuck in the 1920s." + text: "<${{ github.repositoryUrl }}|*Repository*> :star: \n + *Pushed by*: <${{ github.event.pusher.name }}> \n + *Branch*: `${{ github.ref_name }} + *Commit message*: ${{ github.event.head_commit.message }} + " accessory: type: "image" - image_url: "https://is5-ssl.mzstatic.com/image/thumb/Purple3/v4/d3/72/5c/d3725c8f-c642-5d69-1904-aa36e4297885/source/256x256bb.jpg" - alt_text: "Haunted hotel image" + image_url: "${{ github.event.repository.owner.avatar_url }}" + alt_text: "User Avatar" - type: "section" fields: - type: "mrkdwn" - text: "*Average Rating*: 1.0" + text: "*Job Status*: ${{ job.status }}" From 06bec6b4b4d6725b42ae33b64e6cbe0fe29d7b47 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:43:00 -0500 Subject: [PATCH 06/12] update custom message v2 --- .github/workflows/notify.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 58b8b62..8f29585 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -15,10 +15,10 @@ jobs: - type: "section" text: type: "mrkdwn" - text: "<${{ github.repositoryUrl }}|*Repository*> :star: \n - *Pushed by*: <${{ github.event.pusher.name }}> \n - *Branch*: `${{ github.ref_name }} - *Commit message*: ${{ github.event.head_commit.message }} + text: "<${{ github.event.repository.url }}|*Repository*> :star: \n + *Pushed by*: ${{ github.event.pusher.name }} \n + *Branch*: ${{ github.ref_name }} \n + *Commit message*: ${{ github.event.head_commit.message }} " accessory: type: "image" From ad9483bf63419508b3108a8a6fa64be5fef04f01 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 21:45:13 -0500 Subject: [PATCH 07/12] update repository URL --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 8f29585..2a8ab87 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -15,7 +15,7 @@ jobs: - type: "section" text: type: "mrkdwn" - text: "<${{ github.event.repository.url }}|*Repository*> :star: \n + text: "<${{ github.event.repository.html_url }}|*Repository*> :star: \n *Pushed by*: ${{ github.event.pusher.name }} \n *Branch*: ${{ github.ref_name }} \n *Commit message*: ${{ github.event.head_commit.message }} From b447596178e84978c3efe0bd4e8104c96dd90486 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Sun, 26 Oct 2025 23:50:31 -0500 Subject: [PATCH 08/12] feat: update trigger --- .github/workflows/notify.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 2a8ab87..c661c92 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -1,8 +1,12 @@ name: Notify with Slack -on: push +on: + pull_request: + types: [opened, labeled] + jobs: notify: runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name,'notify-slack') }} steps: - name: Post a message in a channel uses: slackapi/slack-github-action@v2.1.1 From f23847e26647c87b17e7e75126661137a7026bd8 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Mon, 27 Oct 2025 00:00:40 -0500 Subject: [PATCH 09/12] feat: update message --- .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 c661c92..6a5e78b 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -20,9 +20,9 @@ jobs: text: type: "mrkdwn" text: "<${{ github.event.repository.html_url }}|*Repository*> :star: \n - *Pushed by*: ${{ github.event.pusher.name }} \n - *Branch*: ${{ github.ref_name }} \n - *Commit message*: ${{ github.event.head_commit.message }} + *PR*: ${{ github.event.pull_request.title }} \n + *Pushed by*: ${{ github.event.pull_request.user }} \n + *Branch*: ${{ github.head_ref }} " accessory: type: "image" From 006da361797447d7bf0e97d63c07d827b52af742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20D=C3=ADaz?= <164126437+christianncode@users.noreply.github.com> Date: Mon, 27 Oct 2025 00:02:05 -0500 Subject: [PATCH 10/12] Potential fix for code scanning alert no. 20: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/notify.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 6a5e78b..5b8a297 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -1,4 +1,7 @@ name: Notify with Slack +permissions: + contents: read + pull-requests: read on: pull_request: types: [opened, labeled] From cd6c79da7749a29cb136adc4c9905b5a87f27f82 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Mon, 27 Oct 2025 00:10:31 -0500 Subject: [PATCH 11/12] feat: update slack message --- .github/workflows/notify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 6a5e78b..d27a398 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -21,8 +21,8 @@ jobs: type: "mrkdwn" text: "<${{ github.event.repository.html_url }}|*Repository*> :star: \n *PR*: ${{ github.event.pull_request.title }} \n - *Pushed by*: ${{ github.event.pull_request.user }} \n - *Branch*: ${{ github.head_ref }} + *Pushed by*: ${{ github.event.pull_request.user.name }} \n + *Branch*: ${{ github.event.pull_request.head.ref }} " accessory: type: "image" From 83b20529dd4c0490fd78d96b1f516447f4a977ba Mon Sep 17 00:00:00 2001 From: chrisdca Date: Mon, 27 Oct 2025 00:20:16 -0500 Subject: [PATCH 12/12] feat: update slack message v2 --- .github/workflows/notify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 06e6c98..fc46336 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -24,8 +24,8 @@ jobs: type: "mrkdwn" text: "<${{ github.event.repository.html_url }}|*Repository*> :star: \n *PR*: ${{ github.event.pull_request.title }} \n - *Pushed by*: ${{ github.event.pull_request.user.name }} \n - *Branch*: ${{ github.event.pull_request.head.ref }} + *Pushed by*: ${{ github.event.pull_request.user.login }} \n + *Branch*: ${{ github.event.pull_request.base.ref }} " accessory: type: "image"