File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments