mirror of
https://github.com/strapi/strapi.git
synced 2026-05-03 16:22:30 +00:00
chore(ci): send Slack notification when flag: documentation label is added (#26057)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
name: Notify docs team on flag:documentation label
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
notify-docs:
|
||||
if: "github.event.label.name == 'flag: documentation'"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Notify Slack
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DOCUMENTATION_OPS }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK" ]; then
|
||||
echo "No Slack webhook configured, skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TEXT=":label: *Docs flag added* on strapi/strapi\n<${PR_URL}|#${PR_NUMBER} — ${PR_TITLE}>\nFlagged by @${ACTOR}"
|
||||
|
||||
FORMATTED=$(printf "$TEXT")
|
||||
curl -s -X POST "$SLACK_WEBHOOK" \
|
||||
-H 'Content-type: application/json' \
|
||||
-d "$(jq -n --arg text "$FORMATTED" '{text: $text}')" || echo "Slack notification failed (non-blocking)"
|
||||
Reference in New Issue
Block a user