mirror of
https://github.com/Pennyw0rth/NetExec.git
synced 2026-11-07 09:26:01 -10:00
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.
This commit is contained in:
1 parent
fbcda8b356
commit
1106f8edaa
2 files changed
+59
No files matched your search
@@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: NetExec Wiki
|
||||
url: https://www.netexec.wiki/
|
||||
about: Check the wiki for usage guides and documentation before opening an issue.
|
||||
- name: NetExec Discord
|
||||
url: https://discord.com/invite/pjwUTQzg8R
|
||||
about: Join the Discord for general questions and community support.
|
||||
@@ -0,0 +1,51 @@
|
||||
name: PR Template Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
check-template:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check PR description for template sections
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const body = context.payload.pull_request.body || '';
|
||||
const requiredSections = [
|
||||
'## Description',
|
||||
'## Type of change',
|
||||
'## Setup guide for the review',
|
||||
'## Checklist'
|
||||
];
|
||||
|
||||
const missingSections = requiredSections.filter(
|
||||
section => !body.includes(section)
|
||||
);
|
||||
|
||||
if (missingSections.length === 0) return;
|
||||
|
||||
// Check if we already left a comment to avoid spamming
|
||||
const comments = await github.rest.issues.listComments({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number
|
||||
});
|
||||
|
||||
const botComment = comments.data.find(
|
||||
c => c.user.type === 'Bot' && c.body.includes('<!-- pr-template-check -->')
|
||||
);
|
||||
|
||||
if (botComment) return;
|
||||
|
||||
const missing = missingSections.map(s => `- ${s}`).join('\n');
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number,
|
||||
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!`
|
||||
});
|
||||
Reference in new issue
Block a user