Skip to content

Commit f363124

Browse files
Merge pull request Pennyw0rth#1105 from Pennyw0rth/marshall_pr_template_check
Add issue template config and PR template check workflow
2 parents fbcda8b + b7137ae commit f363124

3 files changed

Lines changed: 68 additions & 5 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.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ Insert an "x" inside the brackets for relevant items (do not delete options)
1212
- [ ] Deprecation of feature or functionality
1313
- [ ] This change requires a documentation update
1414
- [ ] This requires a third party update (such as Impacket, Dploot, lsassy, etc)
15+
- [ ] This PR was created with the assistance of AI (list what type of assistance, tool(s)/model(s) in the description)
1516

1617
## Setup guide for the review
1718
Please provide guidance on what setup is needed to test the introduced changes, such as your locally running machine Python version & OS, as well as the target(s) you tested against, including software versions.
1819
In particular:
1920
- Bug Fix: Please provide a short description on how to trigger the bug, to make the bug reproducable for the reviewer.
20-
- Added Feature/Enhancement: Please specify what setup is needed in order to test the changes. E.g. is additional software needed? GPO changes required? Specific registry settings that need to be changed?
21+
- Added Feature/Enhancement: Please specify what setup is needed in order to test the changes, such as:
22+
- Is additional software needed?
23+
- GPO changes required?
24+
- Specific registry settings that need to be changed?
2125

2226
## Screenshots (if appropriate):
2327
Screenshots are always nice to have and can give a visual representation of the change.
24-
If appropriate include before and after screenshot(s) to show which results are to be expected.
28+
If appropriate, include before and after screenshot(s) to show which results are to be expected.
2529

2630
## Checklist:
2731
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
2832

29-
- [ ] I have ran Ruff against my changes (via poetry: `poetry run python -m ruff check . --preview`, use `--fix` to automatically fix what it can)
33+
- [ ] I have ran Ruff against my changes (poetry: `poetry run ruff check .`, use `--fix` to automatically fix what it can)
3034
- [ ] I have added or updated the `tests/e2e_commands.txt` file if necessary (new modules or features are _required_ to be added to the e2e tests)
31-
- [ ] New and existing e2e tests pass locally with my changes
3235
- [ ] If reliant on changes of third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
33-
- [ ] I have performed a self-review of my own code
36+
- [ ] I have linked relevant sources that describes the added technique (blog posts, documentation, etc)
37+
- [ ] I have performed a self-review of my own code (_not_ an AI review)
3438
- [ ] I have commented my code, particularly in hard-to-understand areas
3539
- [ ] I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)
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)