Skip to content

Commit 1d0f5db

Browse files
authored
feat: link to @octokit discussion forum when creating repository on @octokit (#65)
1 parent 8e99e90 commit 1d0f5db

File tree

2 files changed

+61
-25
lines changed

2 files changed

+61
-25
lines changed

create-octokit-project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async function main() {
141141
await command("git add README.md");
142142
await command("git commit -m 'docs(README): initial version'");
143143

144-
await createIssueTemplates(answers.packageName);
144+
await createIssueTemplates(useOctokitOrg);
145145
await command("git add .github/ISSUE_TEMPLATE");
146146
await command("git commit -m 'docs(ISSUE_TEMPLATES): initial version'");
147147

lib/create-issue-templates.js

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,66 @@ module.exports = createIssueTemplates;
22

33
const writePrettyFile = require("./write-pretty-file");
44

5-
async function createIssueTemplates(packageName) {
5+
async function createIssueTemplates(isOctokitOrg) {
6+
if (isOctokitOrg) {
7+
await writePrettyFile(
8+
".github/ISSUE_TEMPLATE/01_bug.md",
9+
`---
10+
name: "🐛 Bug Report"
11+
about: "If something isn't working as expected 🤔"
12+
labels: bug
13+
---
14+
15+
<!-- Please replace all placeholders such as this below -->
16+
17+
**What happened?**
18+
19+
<!-- Describe the problem and how to reproduce it. Add screenshots or a link to your repository if helpful. Ideally create a reproducible test case on runkit.com (Example: https://runkit.com/gr2m/octokit-rest-js-1808) -->
20+
21+
**What did you expect to happen?**
22+
23+
<!-- Describe what you expected to happen instead -->
24+
25+
**What the problem might be**
26+
27+
<!-- If you have an idea where the bug might lie, please share here. Otherwise remove the whole section -->
28+
`
29+
);
30+
await writePrettyFile(
31+
".github/ISSUE_TEMPLATE/02_feature_request.md",
32+
`---
33+
name: "🧚‍♂️ Feature Request"
34+
about: "Wouldn’t it be nice if 💭"
35+
labels: feature
36+
---
37+
38+
<!-- Please replace all placeholders such as this below -->
39+
40+
**What’s missing?**
41+
42+
<!-- Describe your feature idea -->
43+
44+
**Why?**
45+
46+
<!-- Describe the problem you are facing -->
47+
48+
**Alternatives you tried**
49+
50+
<!-- Describe the workarounds you tried so far and how they worked for you -->
51+
`
52+
);
53+
54+
await writePrettyFile(
55+
".github/ISSUE_TEMPLATE/config.yml",
56+
`blank_issues_enabled: false
57+
contact_links:
58+
- name: 🆘 I need Help
59+
url: https://github.com/octokit/rest.js/discussions
60+
about: Got a question? An idea? Feedback? Start here.`
61+
);
62+
return;
63+
}
64+
665
await writePrettyFile(
766
".github/ISSUE_TEMPLATE/01_help.md",
867
`---
@@ -57,29 +116,6 @@ labels: feature
57116
**Alternatives you tried**
58117
59118
<!-- Describe the workarounds you tried so far and how they worked for you -->
60-
`
61-
);
62-
await writePrettyFile(
63-
".github/ISSUE_TEMPLATE/04_thanks.md",
64-
`---
65-
name: "💝 Thank you"
66-
about: "${packageName} is awesome 🙌"
67-
labels: thanks
68-
---
69-
70-
<!-- Please replace all placeholders such as this below -->
71-
72-
**How do you use ${packageName}?**
73-
74-
<!-- Please share how you use ${packageName}. What are your use cases? -->
75-
76-
**What do you love about it?**
77-
78-
<!-- Thanks for the kind words 🤗 -->
79-
80-
**How did you learn about it?**
81-
82-
<!-- Just curious -->
83119
`
84120
);
85121
}

0 commit comments

Comments
 (0)