Skip to content

Commit 34ba429

Browse files
committed
Add issue and PR templates, CI workflows, and automation scripts
1 parent ae3c4c8 commit 34ba429

7 files changed

Lines changed: 322 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: 🐛 Bug Report
2+
description: Report a bug or issue
3+
labels: ["bug", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thanks for reporting a bug! Please fill out the details below.
8+
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Description
13+
description: Describe the bug clearly
14+
placeholder: What went wrong?
15+
validations:
16+
required: true
17+
18+
- type: textarea
19+
id: steps
20+
attributes:
21+
label: Steps to Reproduce
22+
description: How do we reproduce the issue?
23+
placeholder: |
24+
1. Go to '...'
25+
2. Click on '...'
26+
3. See the error
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: expected
32+
attributes:
33+
label: Expected Behavior
34+
description: What should happen?
35+
placeholder: describe expected behavior
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: environment
41+
attributes:
42+
label: Environment
43+
description: Browser, OS, Node version, or other relevant info
44+
placeholder: |
45+
- OS: macOS 14.1
46+
- Browser: Chrome 120
47+
- Node: 20.10
48+
validations:
49+
required: false
50+
51+
- type: textarea
52+
id: logs
53+
attributes:
54+
label: Error Logs or Screenshots
55+
description: Paste any error messages or attach screenshots
56+
placeholder: Errors, stack traces, or screenshots
57+
validations:
58+
required: false
59+
60+
- type: checkboxes
61+
id: checklist
62+
attributes:
63+
label: Checklist
64+
options:
65+
- label: I have searched existing issues
66+
required: true
67+
- label: I have provided a clear description
68+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Documentation
4+
url: https://github.com/orgs/open-elements/discussions
5+
about: Questions about usage or architecture
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ✨ Feature Request
2+
description: Suggest an idea or enhancement
3+
labels: ["enhancement", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: We'd love to hear your ideas! Please describe the feature you'd like to see.
8+
9+
- type: textarea
10+
id: problem
11+
attributes:
12+
label: Problem Statement
13+
description: Describe the problem or use case
14+
placeholder: "Is your request related to a problem? Ex. I'm frustrated when..."
15+
validations:
16+
required: true
17+
18+
- type: textarea
19+
id: solution
20+
attributes:
21+
label: Proposed Solution
22+
description: Describe the solution you'd like
23+
placeholder: How should this feature work?
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
id: alternatives
29+
attributes:
30+
label: Alternatives Considered
31+
description: Other options you've explored
32+
placeholder: Any other approaches?
33+
validations:
34+
required: false
35+
36+
- type: textarea
37+
id: context
38+
attributes:
39+
label: Additional Context
40+
description: Any other relevant information
41+
placeholder: Screenshots, examples, links, etc.
42+
validations:
43+
required: false
44+
45+
- type: checkboxes
46+
id: checklist
47+
attributes:
48+
label: Checklist
49+
options:
50+
- label: I have searched existing issues and discussions
51+
required: true
52+
- label: This request aligns with project goals
53+
required: false

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
Brief description of changes made in this PR.
3+
4+
## Type of Change
5+
- [ ] 🐛 Bug fix
6+
- [ ] ✨ New feature
7+
- [ ] 📝 Documentation update
8+
- [ ] 🎨 Style/formatting
9+
- [ ] ♻️ Refactor
10+
- [ ] 🔧 Configuration
11+
- [ ] ⚡ Performance
12+
- [ ] 🧪 Tests
13+
- [ ] 🔐 Security
14+
15+
## Related Issue(s)
16+
Closes #ISSUE_NUMBER
17+
18+
## Changes Made
19+
- Change 1
20+
- Change 2
21+
- Change 3
22+
23+
## How to Test
24+
1. Step 1
25+
2. Step 2
26+
3. Verify the expected behavior
27+
28+
## Checklist
29+
- [ ] Code follows project style guidelines
30+
- [ ] Self-review conducted
31+
- [ ] Comments added for complex logic
32+
- [ ] Documentation updated (if needed)
33+
- [ ] No new warnings generated
34+
- [ ] Tests added/updated (if applicable)
35+
- [ ] All tests passing locally

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v2
22+
with:
23+
version: 8
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'pnpm'
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Lint (if available)
35+
run: pnpm lint 2>/dev/null || echo "Lint script not found, skipping"
36+
continue-on-error: true
37+
38+
- name: Type check (if available)
39+
run: pnpm type-check 2>/dev/null || echo "Type check script not found, skipping"
40+
continue-on-error: true
41+
42+
- name: Test (if available)
43+
run: pnpm test 2>/dev/null || echo "Test script not found, skipping"
44+
continue-on-error: true
45+
46+
- name: Build (if available)
47+
run: pnpm build 2>/dev/null || echo "Build script not found, skipping"
48+
continue-on-error: true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Issue Automation
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
auto-label-and-assign:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Auto-label bug reports
12+
if: contains(github.event.issue.title, 'bug') || contains(github.event.issue.body, 'bug')
13+
uses: actions/github-script@v7
14+
with:
15+
script: |
16+
github.rest.issues.addLabels({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
labels: ['bug']
21+
})
22+
23+
- name: Auto-label feature requests
24+
if: contains(github.event.issue.title, 'feature') || contains(github.event.issue.title, 'enhancement')
25+
uses: actions/github-script@v7
26+
with:
27+
script: |
28+
github.rest.issues.addLabels({
29+
issue_number: context.issue.number,
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
labels: ['enhancement']
33+
})
34+
35+
- name: Auto-assign to maintainer
36+
uses: actions/github-script@v7
37+
with:
38+
script: |
39+
github.rest.issues.addAssignees({
40+
issue_number: context.issue.number,
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
assignees: ['${{ vars.DEFAULT_MAINTAINER || github.repository_owner }}']
44+
}).catch(err => {
45+
console.log('Could not assign maintainer: ' + err.message);
46+
})
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: PR Automation
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
auto-label-and-assign:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Get changed files
17+
id: files
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const { data: { files } } = await github.rest.pulls.listFiles({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
pull_number: context.issue.number,
25+
});
26+
27+
const fileNames = files.map(f => f.filename);
28+
const labels = new Set();
29+
30+
fileNames.forEach(file => {
31+
if (file.match(/\.(ts|tsx|jsx|js)$/)) labels.add('typescript');
32+
if (file.match(/\.(css|scss|postcss)$/)) labels.add('styling');
33+
if (file.match(/test|spec/)) labels.add('tests');
34+
if (file.match(/package\.json|tsconfig|eslint|tailwind/)) labels.add('configuration');
35+
if (file.match(/README|\.md$/)) labels.add('documentation');
36+
if (file.match(/next\.config|public/)) labels.add('build');
37+
});
38+
39+
core.setOutput('labels', Array.from(labels).join(','));
40+
41+
- name: Auto-label PR
42+
if: steps.files.outputs.labels != ''
43+
uses: actions/github-script@v7
44+
with:
45+
script: |
46+
const labels = '${{ steps.files.outputs.labels }}'.split(',').filter(l => l);
47+
if (labels.length > 0) {
48+
github.rest.issues.addLabels({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
labels: labels
53+
});
54+
}
55+
56+
- name: Auto-assign PR to author
57+
uses: actions/github-script@v7
58+
with:
59+
script: |
60+
github.rest.issues.addAssignees({
61+
issue_number: context.issue.number,
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
assignees: [context.payload.pull_request.user.login]
65+
}).catch(err => {
66+
console.log('Could not assign author: ' + err.message);
67+
})

0 commit comments

Comments
 (0)