Update devdocs-notify.yml #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |