Skip to content

Commit 700aef6

Browse files
Merge pull request #8 from AndreaGriffiths11/copilot/create-proper-issues
Add GitHub Actions automation to create issues from templates
2 parents f8d9d3f + 92d4549 commit 700aef6

6 files changed

Lines changed: 177 additions & 20 deletions

File tree

.github/ISSUES/QUICK_START.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Quick Guide: Creating GitHub Issues
2+
3+
This repository has 20 pre-written issue templates in `.github/ISSUES/` that need to be created as actual GitHub issues.
4+
5+
## 🚀 Quick Start (Recommended)
6+
7+
### For Repository Maintainers
8+
9+
1. Go to the [Actions tab](../../actions)
10+
2. Select "Create GitHub Issues from Templates"
11+
3. Click "Run workflow"
12+
4. Type `create` to confirm
13+
5. Click "Run workflow" button
14+
15+
That's it! All 20 issues will be created automatically.
16+
17+
### For Local Development
18+
19+
```bash
20+
cd .github/ISSUES
21+
bash create-issues.sh
22+
```
23+
24+
## 📖 Full Documentation
25+
26+
See [ISSUE_CREATION_GUIDE.md](./ISSUE_CREATION_GUIDE.md) for detailed instructions and alternative methods.
27+
28+
## 📋 What Issues Will Be Created?
29+
30+
The workflow will create 20 issues covering:
31+
- 🧪 Testing (2 issues)
32+
- ⚡ Performance (3 issues)
33+
- ♿ Accessibility (3 issues)
34+
- ✨ Features (7 issues)
35+
- 🎨 UI/UX (1 issue)
36+
- 🏗️ Architecture (2 issues)
37+
- 📚 Documentation (2 issues)
38+
39+
For a detailed summary, see [SUMMARY.md](./SUMMARY.md)

.github/ISSUES/README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ This directory contains 20 improvement proposals for the WeCoded project, organi
4040

4141
## 🚀 Creating Issues on GitHub
4242

43-
### Option 1: Manual Creation
43+
### Option 1: GitHub Actions (Recommended for Maintainers)
4444

45-
1. Navigate to the GitHub repository
46-
2. Click on "Issues" → "New Issue"
47-
3. Copy the content from each `.md` file
48-
4. Paste into the issue body
49-
5. Extract the `title` from the frontmatter
50-
6. Add `labels` from the frontmatter
51-
7. Create the issue
45+
The easiest way to create all issues at once:
46+
47+
1. Go to the **Actions** tab in the GitHub repository
48+
2. Select **"Create GitHub Issues from Templates"** workflow
49+
3. Click **"Run workflow"**
50+
4. Type `create` in the confirmation field
51+
5. Click **"Run workflow"** button
52+
53+
This will automatically create all 20 issues with proper titles, labels, and content.
5254

53-
### Option 2: Using GitHub CLI (Recommended)
55+
### Option 2: Using GitHub CLI (Local Development)
5456

5557
If you have GitHub CLI installed and authenticated, run:
5658

@@ -77,6 +79,16 @@ gh issue create \
7779
--label "testing,enhancement,good-first-issue"
7880
```
7981

82+
### Option 4: Manual Creation
83+
84+
1. Navigate to the GitHub repository
85+
2. Click on "Issues" → "New Issue"
86+
3. Copy the content from each `.md` file
87+
4. Paste into the issue body
88+
5. Extract the `title` from the frontmatter
89+
6. Add `labels` from the frontmatter
90+
7. Create the issue
91+
8092
## 📝 Issue Format
8193

8294
Each issue file contains:

.github/ISSUES/create-issues.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ echo ""
3636
# Function to extract title from frontmatter
3737
get_title() {
3838
local file=$1
39-
grep "^title:" "$file" | sed 's/title: //' | tr -d "'"
39+
grep "^title:" "$file" | sed 's/title: //' | sed "s/^['\"]//;s/['\"]$//"
4040
}
4141

4242
# Function to extract labels from frontmatter
@@ -56,8 +56,8 @@ create_issue() {
5656
local title=$(get_title "$file")
5757
local labels=$(get_labels "$file")
5858

59-
# Remove frontmatter for body (everything between --- markers)
60-
local body=$(sed '1,/^---$/d' "$file" | sed '1,/^---$/d')
59+
# Remove frontmatter for body (everything after second --- marker)
60+
local body=$(awk 'BEGIN{p=0} /^---$/{p++; next} p>=2' "$file")
6161

6262
if [ -z "$title" ]; then
6363
echo -e "${RED} ✗ Could not extract title from $file${NC}"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Create GitHub Issues from Templates
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
confirm:
7+
description: 'Type "create" to confirm issue creation'
8+
required: true
9+
default: ''
10+
11+
jobs:
12+
create-issues:
13+
runs-on: ubuntu-latest
14+
if: github.event.inputs.confirm == 'create'
15+
permissions:
16+
contents: read
17+
issues: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Create issues from templates
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
run: |
27+
cd .github/ISSUES
28+
29+
# Function to extract title from frontmatter
30+
get_title() {
31+
grep "^title:" "$1" | sed 's/title: //' | sed "s/^['\"]//;s/['\"]$//"
32+
}
33+
34+
# Function to extract labels from frontmatter
35+
get_labels() {
36+
grep "^labels:" "$1" | sed 's/labels: //'
37+
}
38+
39+
# Function to extract body (remove frontmatter)
40+
get_body() {
41+
awk 'BEGIN{p=0} /^---$/{p++; next} p>=2' "$1"
42+
}
43+
44+
# Get all issue files sorted by number
45+
for file in $(ls -1 [0-9][0-9]-*.md | sort); do
46+
echo "Processing $file..."
47+
48+
title=$(get_title "$file")
49+
labels=$(get_labels "$file")
50+
body=$(get_body "$file")
51+
52+
if [ -z "$title" ]; then
53+
echo "Error: Could not extract title from $file"
54+
continue
55+
fi
56+
57+
echo "Creating issue: $title"
58+
echo "Labels: $labels"
59+
60+
# Create the issue
61+
echo "$body" | gh issue create \
62+
--title "$title" \
63+
--body-file - \
64+
--label "$labels"
65+
66+
echo "✓ Issue created successfully"
67+
echo ""
68+
69+
# Small delay to avoid rate limiting
70+
sleep 1
71+
done
72+
73+
echo "All issues created successfully!"

ISSUE_CREATION_GUIDE.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ This repository contains 20 detailed improvement issue templates in the `.github
44

55
## Quick Start
66

7+
## Method 1: GitHub Actions Workflow (Recommended for Maintainers)
8+
9+
The easiest way to create all issues at once using automation:
10+
11+
1. Go to the **Actions** tab in your GitHub repository
12+
2. Select **"Create GitHub Issues from Templates"** workflow from the left sidebar
13+
3. Click **"Run workflow"** button (top right)
14+
4. Type `create` in the confirmation field to confirm
15+
5. Click the green **"Run workflow"** button
16+
17+
**What happens:**
18+
- ✅ Automatically creates all 20 issues with proper formatting
19+
- ✅ Applies correct titles and labels from frontmatter
20+
- ✅ Maintains proper ordering (01-20)
21+
- ✅ No local setup required
22+
- ✅ Uses GitHub's built-in authentication
23+
24+
**Note:** This workflow requires write permissions to create issues. If you're a repository maintainer, this is the recommended approach.
25+
26+
---
27+
28+
## Method 2: Automated Script (Local Development)
29+
730
### Prerequisites
831

932
1. **GitHub CLI** installed and authenticated
@@ -22,7 +45,7 @@ This repository contains 20 detailed improvement issue templates in the `.github
2245
cd .github/ISSUES
2346
```
2447

25-
## Method 1: Automated Script (Recommended)
48+
### Running the Script
2649

2750
Run the provided script to create all 20 issues automatically:
2851

@@ -63,7 +86,7 @@ Creating issue from: 01-unit-tests-useFetchStories.md
6386
================================================
6487
```
6588

66-
## Method 2: Manual Creation (One at a Time)
89+
## Method 3: Manual Creation (One at a Time)
6790

6891
If you prefer to create issues individually or selectively:
6992

@@ -106,7 +129,7 @@ gh issue create --title "Implement comprehensive accessibility audit fixes" \
106129
--label "accessibility,a11y,enhancement,bug"
107130
```
108131

109-
## Method 3: Via GitHub Web Interface
132+
## Method 4: Via GitHub Web Interface
110133

111134
If you can't use GitHub CLI:
112135

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,21 @@ npm run build
9898

9999
## 🤝 Contributing
100100

101-
1. Fork the repository
102-
2. Create your feature branch
103-
3. Follow our development guidelines
104-
4. Ensure tests pass
105-
5. Submit a pull request
101+
We have 20 pre-written improvement issues ready to be created! See [ISSUE_CREATION_GUIDE.md](./ISSUE_CREATION_GUIDE.md) for how to create them.
102+
103+
**Quick Start for Maintainers:**
104+
1. Go to the [Actions tab](../../actions)
105+
2. Run the "Create GitHub Issues from Templates" workflow
106+
3. Type `create` to confirm
107+
108+
After issues are created:
109+
1. Pick an issue that matches your skills
110+
2. Comment to express interest
111+
3. Fork the repository
112+
4. Create your feature branch
113+
5. Follow our development guidelines
114+
6. Ensure tests pass
115+
7. Submit a pull request
106116

107117
## 📄 License
108118

0 commit comments

Comments
 (0)