| name | trello-api-trello-with-github-actions |
| description | Sub-skill of trello-api: Trello with GitHub Actions (+1). |
| version | 1.0.0 |
| category | business |
| type | reference |
| scripts_exempt | true |
Trello with GitHub Actions (+1)
Trello with GitHub Actions
name: Sync Issues to Trello
on:
issues:
types: [opened, labeled]
jobs:
create-card:
runs-on: ubuntu-latest
steps:
- name: Create Trello Card
env:
TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }}
TRELLO_TOKEN: ${{ secrets.TRELLO_TOKEN }}
TRELLO_LIST_ID: ${{ secrets.TRELLO_LIST_ID }}
run: |
curl -s -X POST "https://api.trello.com/1/cards" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "idList=$TRELLO_LIST_ID" \
-d "name=${{ github.event.issue.title }}" \
-d "desc=${{ github.event.issue.body }}" \
-d "urlSource=${{ github.event.issue.html_url }}"
Trello with Slack
"""trello_slack_integration.py - Notify Slack on Trello updates"""
import os
import requests
from flask import Flask, request, jsonify
app = Flask(__name__)
SLACK_WEBHOOK_URL = os.environ["SLACK_WEBHOOK_URL"]
@app.route("/webhook/trello", methods=["HEAD", "POST"])
def trello_webhook():
if request.method == "HEAD":
return "", 200
data = request.json
action = data.get("action", {})
action_type = action.get("type")
message = None
if action_type == "createCard":
card = action["data"]["card"]
list_name = action["data"]["list"]["name"]
member = action["memberCreator"]["fullName"]
message = {
"text": f"New card created by {member}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"*New Card Created*\n"
f"*Card:* {card['name']}\n"
}
}
]
}
action_type == action[]:
card = action[][]
list_before = action[][][]
list_after = action[][][]
member = action[][]
message = {
: ,
: [
{
: ,
: {
: ,
:
}
}
]
}
message:
requests.post(SLACK_WEBHOOK_URL, json=message)
jsonify({: })
__name__ == :
app.run(port=)