Skip to content

Commit 1106f8e

Browse files
Add issue template config and PR template check workflow
Disable blank issues and add contact links for the wiki and Discord. Add a GitHub Actions workflow that comments on PRs missing template sections.
1 parent fbcda8b commit 1106f8e

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: NetExec Wiki
4+
url: https://www.netexec.wiki/
5+
about: Check the wiki for usage guides and documentation before opening an issue.
6+
- name: NetExec Discord
7+
url: https://discord.com/invite/pjwUTQzg8R
8+
about: Join the Discord for general questions and community support.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PR Template Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
jobs:
8+
check-template:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- name: Check PR description for template sections
14+
uses: actions/github-script@v7
15+
with:
16+
script: |
17+
const body = context.payload.pull_request.body || '';
18+
const requiredSections = [
19+
'## Description',
20+
'## Type of change',
21+
'## Setup guide for the review',
22+
'## Checklist'
23+
];
24+
25+
const missingSections = requiredSections.filter(
26+
section => !body.includes(section)
27+
);
28+
29+
if (missingSections.length === 0) return;
30+
31+
// Check if we already left a comment to avoid spamming
32+
const comments = await github.rest.issues.listComments({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
issue_number: context.payload.pull_request.number
36+
});
37+
38+
const botComment = comments.data.find(
39+
c => c.user.type === 'Bot' && c.body.includes('<!-- pr-template-check -->')
40+
);
41+
42+
if (botComment) return;
43+
44+
const missing = missingSections.map(s => `- ${s}`).join('\n');
45+
46+
await github.rest.issues.createComment({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
issue_number: context.payload.pull_request.number,
50+
body: `<!-- pr-template-check -->\nIt looks like the PR template may not have been filled out. The following sections appear to be missing:\n\n${missing}\n\nPlease edit your PR description to include them. The template helps reviewers understand and test your changes. Thanks!`
51+
});

0 commit comments

Comments
 (0)