-
-
Notifications
You must be signed in to change notification settings - Fork 33
70 lines (63 loc) · 2.29 KB
/
add-issue-to-trello.yml
File metadata and controls
70 lines (63 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Sync Issues to Trello
on:
issues:
types: [opened]
issue_comment:
types: [created]
schedule:
- cron: "*/10 * * * *" # Run every 10 minutes
workflow_dispatch:
inputs:
sync_mode:
description: "Sync Mode"
required: true
default: "all"
type: choice
options:
- all
- single_issue
issue_number:
description: "Issue Number (if Single Issue mode)"
required: false
default: ""
jobs:
sync-trello:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Sync All Issues (Scheduled or Manual Bulk)
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.sync_mode == 'all') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }}
TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }}
TRELLO_LIST_ID: ${{ secrets.TRELLO_LIST_ID }}
run: python scripts/sync_to_trello.py --all
- name: Sync Specific Issue (Manual Single)
if: ${{ github.event_name == 'workflow_dispatch' && inputs.sync_mode == 'single_issue' && inputs.issue_number != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }}
TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }}
TRELLO_LIST_ID: ${{ secrets.TRELLO_LIST_ID }}
run: python scripts/sync_to_trello.py --issue ${{ inputs.issue_number }}
- name: Sync New Issue or Comment (Automated)
if: ${{ github.event_name == 'issues' || github.event_name == 'issue_comment' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }}
TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }}
TRELLO_LIST_ID: ${{ secrets.TRELLO_LIST_ID }}
run: python scripts/sync_to_trello.py --issue ${{ github.event.issue.number }}