From d87e98bf091a0c180f2ede53bcf5b3da4b737a09 Mon Sep 17 00:00:00 2001 From: antoniomorello-DB Date: Wed, 10 Sep 2025 10:57:04 -0400 Subject: [PATCH 1/3] Create devdocs-notify.yml --- .github/workflows/devdocs-notify.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/devdocs-notify.yml diff --git a/.github/workflows/devdocs-notify.yml b/.github/workflows/devdocs-notify.yml new file mode 100644 index 0000000..91ef71e --- /dev/null +++ b/.github/workflows/devdocs-notify.yml @@ -0,0 +1,35 @@ +name: DevDocs PR or Issue Creation Notifier +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Check for new PR or issues + uses: actions/github-script@v7 + with: + script: | + const text = context.payload.comment?.body + || context.payload.issue?.body + || context.payload.pull_request?.body + || context.payload.review?.body + || ""; + + await fetch(process.env.SLACK_WEBHOOK_URL, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + text: `:eyes: @DevDocs a PR was opened or issue created in *${context.payload.repository.full_name}* + Event: *${context.eventName}* + Link: ${context.payload.comment?.html_url + || context.payload.issue?.html_url + || context.payload.pull_request?.html_url + || context.payload.review?.html_url}` + }), + }); + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 570b8e347d8123fda1a6eb522ce20f8491ad5420 Mon Sep 17 00:00:00 2001 From: antoniomorello-DB Date: Wed, 10 Sep 2025 14:07:35 -0400 Subject: [PATCH 2/3] Remove comments payload Co-authored-by: cory <115956901+cbullinger@users.noreply.github.com> --- .github/workflows/devdocs-notify.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/devdocs-notify.yml b/.github/workflows/devdocs-notify.yml index 91ef71e..552ba58 100644 --- a/.github/workflows/devdocs-notify.yml +++ b/.github/workflows/devdocs-notify.yml @@ -13,10 +13,8 @@ jobs: uses: actions/github-script@v7 with: script: | - const text = context.payload.comment?.body - || context.payload.issue?.body + const text = context.payload.issue?.body || context.payload.pull_request?.body - || context.payload.review?.body || ""; await fetch(process.env.SLACK_WEBHOOK_URL, { From c93a8e7b4a86d4f90f15a2386268f31b1f2fdfaa Mon Sep 17 00:00:00 2001 From: antoniomorello-DB Date: Thu, 11 Sep 2025 12:49:28 -0400 Subject: [PATCH 3/3] Update pull_request_target to run in the base repo context --- .github/workflows/devdocs-notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devdocs-notify.yml b/.github/workflows/devdocs-notify.yml index 552ba58..9e6d3c7 100644 --- a/.github/workflows/devdocs-notify.yml +++ b/.github/workflows/devdocs-notify.yml @@ -2,7 +2,7 @@ name: DevDocs PR or Issue Creation Notifier on: issues: types: [opened] - pull_request: + pull_request_target: types: [opened] jobs: