diff --git a/.github/workflows/devdocs-notify.yml b/.github/workflows/devdocs-notify.yml new file mode 100644 index 0000000..9e6d3c7 --- /dev/null +++ b/.github/workflows/devdocs-notify.yml @@ -0,0 +1,33 @@ +name: DevDocs PR or Issue Creation Notifier +on: + issues: + types: [opened] + pull_request_target: + 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.issue?.body + || context.payload.pull_request?.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 }}