GitHub add to Projects Automation
Why GitHub Projects?
I’ve been a fan of GitHub Projects1 for years now. It’s a simple, effective way to track tasks across repositories, and it integrates naturally with the GitHub ecosystem I’m already living in. For someone like me who manages multiple personal projects across different repositories, having everything organized in one place is a game-changer.
But there’s a catch.
If you want issues and pull requests from all your repositories to automatically appear in your project board, GitHub nudges you toward their Enterprise tier. Not exactly budget-friendly for a solo developer or small team.
The Problem: Manual Work is Still Work
I use my GitHub project board as my daily to-do list for personal repositories. Manually adding every new issue and pull request to the board isn’t just tedious—it’s exactly the kind of repetitive task that should be automated.
What I needed was a way to ensure both public AND private repositories would automatically add their issues and PRs to my central project board, without having to pay for features I don’t need.
The Solution: GitHub Actions to the Rescue
After some digging (and a late night of caffeine-fueled experimentation), I found that GitHub Actions could solve this elegantly. By adding a simple workflow file to each repository, I could automate the process of adding new issues and PRs to my central project board.
Here’s the workflow file I use:
|
|
How It Works
The workflow is surprisingly straightforward (I was honestly expecting more complexity):
Event Triggers: The workflow kicks in whenever someone opens a new issue or creates a pull request.
Simple Job: It runs a single job that uses the
actions/add-to-project
action to add the new item to my project board. No fuss.Configuration: I just need to specify my project URL and provide a Personal Access Token with the right permissions.
Setting Up Your Personal Access Token
For this workflow to function properly, you’ll need to create a Personal Access Token (PAT) with appropriate permissions:
- Go to GitHub Settings → Developer settings → Personal access tokens2.
- Click on “Tokens (classic)” and then “Generate new token.”
- Generate a new token with at least the following scopes:
repo
(for accessing repositories)project
(for modifying project boards)
- Add this token as a repository secret named
ADD_TO_PROJECT_PAT
Implementation Across Multiple Repositories
The beauty of this approach is its scalability. I’ve added this workflow file to all my active repositories, both public and private. Since each repository runs its own GitHub Actions workflows, they can all independently add their issues and PRs to my central project board.
I’ll be honest - the first time I saw it all working together, with issues from five different repos automatically appearing in my project board, I did a little happy dance in my office. It’s the small wins, right?
Benefits I’ve Seen
After implementing this workflow across my repositories, I’ve noticed several improvements:
Complete Visibility: All my tasks from different repositories appear in one place without manual intervention. No more “oh crap, I forgot about that issue I opened last week.”
No More Forgotten Tasks: Every new issue automatically shows up in my to-do list, so nothing slips through the cracks. My goldfish memory is finally not a liability!
Cost Efficiency: I get the automatic organization I need without upgrading to a more expensive GitHub plan. Sorry GitHub, you’ll have to try harder to get my credit card details.
Potential Improvements
This basic workflow does exactly what I need, but there are some ways you could extend it:
- Add more event types like
issue_comment
to track activity3 - Create custom logic to assign items to specific columns based on labels
- Add filtering logic to only include certain issues based on criteria
I haven’t felt the need to add these bells and whistles yet, but they’re there if you want to get fancy.
Conclusion
GitHub Projects is a powerful tool for organizing work, and with this simple automation workflow, you can get enterprise-like features without the enterprise price tag. It’s made my daily workflow much smoother, keeping all my tasks organized across multiple repositories with zero manual effort.
The best part? It’s just a simple YAML file that you can copy, paste, and adapt to your own workflow needs. Sometimes the simplest solutions really are the best.
Github Documentation for personal access tokens ↩︎
GitHub Actions Documentation for workflow syntax ↩︎