Test with posts API and bot
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/push/deploy unknown status

This commit is contained in:
2026-02-12 01:12:10 -03:00
parent 14edd403eb
commit ceeb76663b

View File

@@ -33,14 +33,33 @@ steps:
MATTERMOST_BOT_ACCESS_TOKEN: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token from_secret: mattermost_bot_access_token
commands: commands:
# - |
# BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
# curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_WEBHOOK_URL"
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"qgg5yxg67y85q53syijgj4ase","message":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" https://labs.mifi.dev/api/v4/posts
depends_on: depends_on:
- lint - lint
when: when:
- status: [failure] - status: [failure]
- name: Send Lint Status Notification (success)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
commands:
- |
BODY=$(printf '{"channel_id":"qgg5yxg67y85q53syijgj4ase","message":"[%s - Build #%s] Lint success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" https://labs.mifi.dev/api/v4/posts
depends_on:
- lint
when:
- status: [success]
- name: build - name: build
image: node:20-alpine image: node:20-alpine
commands: commands: