diff --git a/.github/workflows/devdocs-notify.yml b/.github/workflows/devdocs-notify.yml new file mode 100644 index 0000000..5c767c1 --- /dev/null +++ b/.github/workflows/devdocs-notify.yml @@ -0,0 +1,33 @@ +name: DevDocs PR or Issue Creation Notifier +on: + 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 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 }} diff --git a/manifest.json b/manifest.json index 789901f..3d53a5d 100644 --- a/manifest.json +++ b/manifest.json @@ -22,5 +22,5 @@ "metadata": "/snippets/triggers/project/manifest.json" } ], - "version": "5ecb1bb545fba2bae516638e3e099094d5553f58" + "version": "a4f0e8250870b34abc7dca13d2ad79ec687d1f25" }