Skip to content

TeamYayin/github-to-trello-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Project → Trello Sync (Deduplicated)

🔩 GitHub Project to Trello Sync

This repository syncs items from one or more GitHub Projects (v2) to a Trello list using a GitHub Actions workflow.


♻️ What it does

  • ✅ Fetches issues and draft items from GitHub Projects
  • ✅ Posts them to a specified Trello list as cards
  • ✅ Skips duplicates using a tracked list of posted IDs
  • ✅ Supports scheduled runs (Mon, Wed, Fri) or manual trigger
  • ✅ Tracks sync history using a posted_ids.json file (stored via workflow artifacts or committed)

📂 Repo Structure

.
├── sync.py                # Main Python script to sync items
├── sync.yml              # GitHub Actions workflow
├── .cache/
│   └── posted_ids.json   # (optional) locally committed cache of posted IDs
└── README.md

🚀 Setup Instructions

1. Fork this repo or make it private/public

You can safely use this code in a public repo if you follow the security steps below.


2. Create the required GitHub secrets

Go to: Settings → Secrets and variables → Actions → New repository secret

Name Description
GH_TOKEN_ISSUES A GitHub PAT with read:project & repo scopes
GH_PROJECT_ID A JSON string array of GitHub ProjectV2 IDs (e.g. ["PVT_12345", "PVT_67890"])
TRELLO_KEY Your Trello API Key
TRELLO_TOKEN Your Trello API Token (see token generation notes below)
TRELLO_LIST_ID The ID of the list (not the board) where cards should be created

3. Optional: Pre-fill cache

To avoid reposting old issues:

  • Create .cache/posted_ids.json with:
[]

Or manually upload one from a previous sync run via GitHub Actions → Artifacts.


4. Run the Workflow

  • Manually via the "Run workflow" button in Actions tab
  • Or let it run on schedule (defaults to Mon, Wed, Fri at 00:00 UTC)

🛡️ Security Notes

  • All tokens are managed via GitHub Secrets
  • No tokens or credentials are hardcoded in the repo
  • The sync script does not send issue body text unless you enable it (by default it's included—can be truncated)

📌 How to get Trello idList (List ID)

  1. Open the list on Trello.
  2. Click on the list title to view it in URL:
    https://trello.com/b/<board_id>/<board-name>/list/<list_id>
    
  3. The list_id is what you set as TRELLO_LIST_ID.

🧪 Local Test

To run locally:

export GITHUB_TOKEN=ghp_...
export TRELLO_KEY=...
export TRELLO_TOKEN=...
export TRELLO_LIST_ID=...
export GITHUB_PROJECT_ID='["PVT_..."]'
python sync.py

📝 Credits

Developed by @py563 Yayin AI Lab Feel free to fork and customize for your own workflows!

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages