Skip to content

Commit c51ef18

Browse files
authored
chore: add issue form templates (#817)
1 parent 68e2f92 commit c51ef18

File tree

5 files changed

+182
-17
lines changed

5 files changed

+182
-17
lines changed

.github/ISSUE_TEMPLATE.md

-17
This file was deleted.

.github/ISSUE_TEMPLATE/bug.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 🐛 Bug report
2+
description: Create a report to help us improve
3+
labels: ["bug"]
4+
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Describe the bug
10+
description: A clear and concise description of what the bug is
11+
validations:
12+
required: true
13+
14+
- type: input
15+
id: reproduce-code
16+
attributes:
17+
description: |
18+
If possible, the best way to display an issue is by making a reproducable code snippet available at jsfiddle.
19+
Create a dotnet fiddle which reproduces your issue. You can use [this template](https://p1k.se/sharpziplib-repro) or [create a new one](https://dotnetfiddle.net/).
20+
placeholder: https://dotnetfiddle.net/r39r0c0d3
21+
label: Reproduction Code
22+
23+
- type: textarea
24+
id: reproduce-steps
25+
attributes:
26+
label: Steps to reproduce
27+
description: Steps to reproduce the behavior
28+
placeholder: |
29+
1. Go to '...'
30+
2. Click on '....'
31+
3. Scroll down to '....'
32+
4. See error
33+
validations:
34+
required: true
35+
36+
- id: expected
37+
type: textarea
38+
attributes:
39+
label: Expected behavior
40+
description: A clear and concise description of what you expected to happen.
41+
validations:
42+
required: true
43+
44+
- id: operating-system
45+
type: dropdown
46+
attributes:
47+
label: Operating System
48+
multiple: true
49+
options:
50+
- Windows
51+
- macOS
52+
- Linux
53+
validations:
54+
required: false
55+
56+
- id: framework
57+
type: dropdown
58+
attributes:
59+
label: Framework Version
60+
multiple: true
61+
options:
62+
- .NET 7
63+
- .NET 6
64+
- .NET 5
65+
- .NET Core v3 and earlier
66+
- .NET Framework 4.x
67+
- Unity
68+
- Other
69+
validations:
70+
required: false
71+
72+
- id: tags
73+
type: dropdown
74+
attributes:
75+
label: Tags
76+
description: What areas are your issue related to?
77+
multiple: true
78+
options:
79+
- ZIP
80+
- GZip
81+
- Tar
82+
- BZip2
83+
- Encoding
84+
- Encryption
85+
- Documentation
86+
- Async
87+
- Performance
88+
89+
- type: textarea
90+
attributes:
91+
label: Additional context
92+
description: Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/icsharpcode/SharpZipLib/discussions/new?category=q-a
5+
about: Post any questions in QA discussions instead of creating an issue
6+
- name: Discuss
7+
url: https://github.com/icsharpcode/SharpZipLib/discussions/new
8+
about: Discuss with other community members
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 💡 Feature request
2+
description: Have a new idea/feature ? Please suggest!
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Is your feature request related to a problem? Please describe.
9+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: solution
15+
attributes:
16+
label: Describe the solution you'd like
17+
description: A clear and concise description of what you want to happen.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: alternatives
23+
attributes:
24+
label: Describe alternatives you've considered
25+
description: A clear and concise description of any alternative solutions or features you've considered.
26+
validations:
27+
required: true
28+
29+
- id: tags
30+
type: dropdown
31+
attributes:
32+
label: Tags
33+
description: What areas are your feature request related to?
34+
multiple: true
35+
options:
36+
- ZIP
37+
- GZip
38+
- Tar
39+
- BZip2
40+
- Encoding
41+
- Encryption
42+
- Documentation
43+
- Async
44+
- Performance
45+
46+
- type: textarea
47+
id: extrainfo
48+
attributes:
49+
label: Additional context
50+
description: Add any other context or screenshots about the feature request here.
51+
validations:
52+
required: false

.github/workflows/issue.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Apply labels from issue
2+
3+
on:
4+
issues:
5+
types: [opened, edited]
6+
7+
jobs:
8+
Process_Issue:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Parse Issue Forms Body
12+
id: parse
13+
uses: zentered/issue-forms-body-parser@v1.4.3
14+
- name: Apply labels from tags
15+
uses: actions/github-script@v6
16+
env:
17+
PARSED_DATA: "${{ steps.parse.outputs.data }}"
18+
with:
19+
script: |
20+
const parsed = JSON.parse(process.env["PARSED_DATA"]);
21+
const tags = parsed.tags.text;
22+
console.log('Parsed tags:', tags);
23+
const labels = tags.split(',').map( t => t.trim().toLowerCase() );
24+
console.log('Applying labels:', labels);
25+
github.rest.issues.addLabels({
26+
issue_number: context.issue.number,
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
labels,
30+
})

0 commit comments

Comments
 (0)