Skip to content

Create devdocs-notify.yml for when a PR is created #1

Create devdocs-notify.yml for when a PR is created

Create devdocs-notify.yml for when a PR is created #1

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 }}