Bulk opens batches of issues (or posts comments) across GitHub repositories based on a template and CSV of values. Think of it like "mail merge" for GitHub issues.
MIT License
Bulk opens batches of issues (or posts comments) across GitHub repositories based on a template and CSV of values. Think of it like "mail merge" for GitHub issues. It can be run locally, via Codespaces, or via GitHub Actions.
name
field in the example above, it might look something like this:git clone https://github.com/benbalter/bulk-issue-creator
bulk-issue-creator init
to create a ./config/data.csv
and ./config/template.md.mustache
filesGITHUB_TOKEN
environmental variable, or add it to a .env
file in the root of the repository in the form of GITHUB_TOKEN=XXX
.bulk-issue-creator
to preview the outputbulk-issue-creator --write
to create the issues.Don't want to deal with the hassle of setting up a local Ruby environment? No worries. With a little copy/paste can use GitHub actions to open issues from the cloud!:
Create a new repository (public or private)
Follow the "Setup" instructions below to add the CSV and template to the repository.
If you'd like to open issues in a repository other than the one containing the action, store a personal access token you create as the PERSONAL_ACCESS_TOKEN
Actions Secret within the repository settings
Create a .github/workflows/bulk-issue-creator.yml
file with the following contents:
on:
workflow_dispatch:
inputs:
write:
description: "Change to 'true' to create issues, leave as 'false' to preview output"
default: "false"
type: boolean
name: Bulk issue creator
jobs:
bulk_issue_creator:
runs-on: ubuntu-latest
name: Bulk Issue Creator
steps:
- name: Checkout template and data
uses: actions/checkout@v2
- name: Create bulk issues
uses: benbalter/bulk-issue-creator@v2
with:
write: ${{ github.event.inputs.write }}
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Navigate to Actions
-> Bulk issue creator
-> Run Workflow
and click Run Workflow
to preview the output.
Note: once you run the workflow, you can see the output by clicking Bulk issue creator
in the side bar, and then clicking into the most recent run.
Repeat step 5, changing the false
text input to true
in the final dialog to create issues.
bulk-issue-creator init
or manually create a CSV file in ./config/data.csv
. The CSV must have columns for repository
and title
(for issues) or issue_number
(for comments). All field names are case sensitive. You can also add any other columns you would like, which will be available to the template. It should look something like this:
repository,title,project,labels
benbalter/gman,Update GMan,GMan,"Red,Blue"
benbalter/jekyll-auth,Update Jekyll Auth,Jekyll Auth,"Green,Blue"
./config/template.md.mustache
file in the same directory with the content you want in the issue body. You can reference CSV fields like {{project}}
using the Mustache syntax. It should look something like this:
Hey there! It looks like it's time to update {{project}}!
repo
scope.Templates (and issue titles) support the Mustache syntax syntax by default. Field names in the CSV should be lower case, and should use _
s to separate multiple words like_this
, instead of spaces.
Note: You can also use the slightly more advanced Liquid templating system by passing the liquid
option (see below).
Options can be passed as command-line arguments when running locally or via the with:
property of GitHub Actions. Both locally and when running via GitHub actions, options can also be passed via environment variables. See the table below for available options and how to pass them:
Command line | GitHub Actions with:
|
GitHub Actions env:
|
Description |
---|---|---|---|
--write | write: | WRITE: | Write issues to GitHub (default: false) |
--comment | comment: | COMMENT: | Create comments instead of issues |
--template-path | template_path: | TEMPLATE_PATH: | Path to the template file |
--csv-path | csv_path: | CSV_PATH: | Path to the CSV file |
--liquid | liquid: | LIQUID: | Use Liquid template engine (default: false) |
--github-token | github_token: | GITHUB_TOKEN: | GitHub Token for authenticating with GitHub |
labels
or assignees
column to the CSV, with a comma-separated list of labels or assignees that you'd like added to the issue.issue_number
column to the CSV, with the issue number you'd like the comment added to. Note: You must pass the --comment
flagIf you'd like to add created issues to a project board, I suggest adding a specific label and using actions/add-to-project
to add the issue to the project board.