Aller au contenu principal

Notifications

DocStatic uses GitHub Actions to send workflow notifications. Example review and translate notifications are included in the .github/workflows/ folder. Some configuration in GitHub is required to enable them. You can also use them as the starting point to develop your own custom notifications.

Email

The email-review.yml and email-translate.yml actions are triggered when either the review or translate tags are set on a markdown file in the main branch. To use them, add these secrets to your repository:

  • SMTP_SERVER
  • SMTP_PORT
  • SMTP_USERNAME
  • SMTP_PASSWORD
  • NOTIFY_EMAIL_TO
  • NOTIFY_EMAIL_FROM

You can get this information from your email provider. For example:

Slack

The slack-review.yml and slack-translate.yml actions use the same triggers as the email versions. To use them, add your Slack webhook URL as a secret named SLACK_WEBHOOK_URL. For more information, refer to Sending messages using incoming webhooks in the Slack documentation.

Teams

The teams-review.yml and teams-translate.yml actions work like the Slack versions. Microsoft is deprecating the Incoming Webhooks app for Teams from December 2025, but currently there isn't a publicly available GitHub method for sending Adaptive Cards to workflows. The workaround is to use curl:

- name: Send Teams test notification
run: |
curl --ssl-no-revoke -X POST \
--location ${{ secrets.MS_TEAMS_HTTP_POST_URL }} \
--header 'Content-Type: application/json' \
--data '{ \
"type": "message", \
"attachments": [{ \
"contentType": "application/vnd.microsoft.card.adaptive", \
"content": { \
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", \
"type": "AdaptiveCard", \
"version": "1.3", \
"body": [ { \
"type": "TextBlock", \
"text": "This is a test notification from GitHub Actions (Teams).", \
"wrap": true }]}}]}'
  1. In Teams, go to the channel you want to send messages, click the elipsis () and select Workflows.
  2. Click Manage.
  3. Click New Flow.
  4. Search templates for webhooks and click Send webhook alerts to a channel.
  5. (Optional) Edit the Flow name.
  6. Sign in and click Next.
  7. Select a Team and Channel from the lists and click Create Flow.
  8. Copy the MS_TEAMS_HTTP_POST_URL and store it as a secret in GitHub and click Done.
Tip

You can use the Test notifications GitHub action to test your connections.