This script automates the creation of GitHub Project items from a structured CSV file. It uses the GitHub CLI (gh) to create and populate project items dynamically based on fields like Feature, Role, and Estimate.
The CSV file should follow this format:
Module,Feature,Task,Role,Hours
Auth,Login,Design login UI layout,Frontend,4
Auth,Login,Implement login form & validation,Frontend,4
Auth,Login,Develop login API endpoint,Backend,6
Auth,Login,Integrate Keycloak authentication,Backend,6- Module: Logical grouping (optional for now)
- Feature: Populates the
Featurefield in the project - Task: Title of the project item
- Role: Populates the
Rolefield - Hours: Populates the
Estimatefield as a number
- Install GitHub CLI
- Authenticate using
gh auth login - Make sure you have access to the GitHub project and it’s a Project (Beta) (aka Projects v2)
Make the script executable and run it:
chmod +x csv2ghproj.sh
./csv2ghproj.sh <CSV_FILE_PATH> <OWNER> <PROJECT_ID>The script:
- Dynamically fetches field IDs from the GitHub project
- Creates draft items with titles from your CSV
- Populates
Feature,Role, andEstimatefields for each item
You can easily extend the script to support:
- Setting Status (single-select field)
- Assigning reviewers
- Linking pull requests or milestones
- Parsing additional CSV columns like
Start DateorEpic
MIT License. Do as you wish.
Pull requests welcome! If you improve the script or make it more robust, feel free to open a PR.