Create Issue workflow
This repository contains a GitHub Actions workflow that creates an issue in a specified repository when triggered manually, and optionally adds it to a GitHub Project.
Usage
- Set a repository secret named
GH_TOKENwith a personal access token that hasreposcope (or appropriate permissions for the target repo). - If using the project assignment feature, ensure your token also has the
projectscope. - Trigger the workflow from the Actions UI or via the GitHub CLI. Provide the
repository(owner/repo),title, optionalbody, optionallabels(comma-separated), and optionalproject_number.
Example (GitHub CLI):
# Create an issue without adding to a project
gh workflow run "Create Issue" --repo OWNER/REPO --field repository="octocat/Hello-World" --field title="Bug report" --field body="Details..." --field labels="bug,high-priority"
# Create an issue and add it to project #1
gh workflow run "Create Issue" --repo OWNER/REPO --field repository="octocat/Hello-World" --field title="Feature request" --field body="Add new feature" --field project_number="1"Parameters
repository(required): The target repository inowner/repoformattitle(required): The issue titlebody(optional): The issue descriptionlabels(optional): Comma-separated list of labels to applyproject_number(optional): The project number (e.g., 1 for project #1) to add the issue to
Requirements for Project Assignment
To use the project assignment feature:
- Your
GH_TOKENmust have bothrepoandprojectscopes - The project must exist in the target repository
- You must have write access to the project