Skip to content

Commit 72002a1

Browse files
committed
ci: add WW-Auto Trello status notify workflow
1 parent 0b499e6 commit 72002a1

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/ww-ci-status.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: WW CI Status to Trello
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
types: [completed]
7+
branches: ["ww/**"]
8+
9+
jobs:
10+
notify-trello:
11+
if: ${{ github.event.workflow_run.conclusion != 'cancelled' }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Extract card ID from branch name
15+
id: extract
16+
run: |
17+
branch="${{ github.event.workflow_run.head_branch }}"
18+
card_id=$(echo "$branch" | sed -n 's|ww/[^/]*/\([^-]*\)-.*|\1|p')
19+
echo "card_id=$card_id" >> "$GITHUB_OUTPUT"
20+
- name: Post CI status to Trello
21+
env:
22+
TRELLO_KEY: ${{ secrets.TRELLO_KEY }}
23+
TRELLO_TOKEN: ${{ secrets.TRELLO_TOKEN }}
24+
STATUS: ${{ github.event.workflow_run.conclusion }}
25+
DETAILS_URL: ${{ github.event.workflow_run.html_url }}
26+
CARD_ID: ${{ steps.extract.outputs.card_id }}
27+
run: |
28+
if [ -z "$CARD_ID" ]; then
29+
echo "Could not extract card ID from branch — skipping"
30+
exit 0
31+
fi
32+
if [ "$STATUS" = "success" ]; then
33+
BODY="CI-passed: $DETAILS_URL"
34+
else
35+
BODY="CI-failed ($STATUS): $DETAILS_URL"
36+
fi
37+
curl -fsS -X POST "https://api.trello.com/1/cards/$CARD_ID/actions/comments" \
38+
-d "key=$TRELLO_KEY&token=$TRELLO_TOKEN&text=$BODY"

0 commit comments

Comments
 (0)