1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/slackmessage/send-to-channel-slack.yaml
2020-04-20 11:50:06 +01:00

28 lines
782 B
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: send-to-channel-slack
spec:
params:
- name: token-secret
type: string
description: secret name of the slack app access token (key is token)
- name: channel
type: string
description: channel id or channel name
- name: message
type: string
description: plain text message
steps:
- name: post
image: curlimages/curl:7.68.0
script: |
#!/bin/sh
/usr/bin/curl -X POST -H 'Content-type: application/json' -H 'Authorization: Bearer '$TOKEN --data '{"channel":"$(params.channel)", "text":"$(params.message)"}' https://slack.com/api/chat.postMessage
env:
- name: TOKEN
valueFrom:
secretKeyRef:
name: $(params.token-secret)
key: token