Skip to content

Update devdocs-notify.yml #21

Update devdocs-notify.yml

Update devdocs-notify.yml #21

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
env:
REPO_NAME: ${{ github.repository }}
# Make sure this secret name matches what is in your Repo Settings
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
# Build Slack payload safely using jq
SLACK_PAYLOAD=$(jq -n \
--arg repo "$REPO_NAME" \
'{
"channel": "#docs-devdocs-notifications",
"username": "Issue Notifier",
"icon_emoji": ":mega:",
"text": "📢 @DevDocs a PR was opened or issue created in \($repo)"
}')
# Send to Slack
curl -X POST \
-H 'Content-type: application/json' \
--data "$SLACK_PAYLOAD" \
"$SLACK_WEBHOOK"