Antoniomorello db patch 2 #7
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: | |
| types: [opened] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| steps: | |
| - name: Debug Slack URL | |
| run: echo "Webhook=${SLACK_WEBHOOK_URL}" | |
| - name: Check for new PR or issues | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const url = process.env.SLACK_WEBHOOK_URL; | |
| console.log("Slack URL (first 10 chars):", url?.substring(0, 10)); | |
| await fetch(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.pull_request?.html_url || context.payload.issue?.html_url}` | |
| }), | |
| }); |