Skip to content

Commit

Permalink
Merge pull request #9 from RohithSurya/features/32065_templates
Browse files Browse the repository at this point in the history
[#32065] Create new issue templates
  • Loading branch information
amila-desilva authored Jun 17, 2024
2 parents 3b8e08e + 12bbb74 commit afcd26d
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Use WorkUnit submit..
2. Add parameters....

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Windows, Mac, Linux]
- PyHPCC Version [e.g. 22]


**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- e.g. [#1020] Make bash_runcommand in WorkUnitSubmit class configurable -->

<!-- Add the issue number to the "Fixes" keyword below. This will automatically close the issue once the PR is merged -->
Fixes #
Fixes [#<JIRA ID>](https://hpccsystems.atlassian.net/browse/HPCC-<JIRA ID>)

### Type of change: <!--- Bug, Feature, Test, Doc -->

Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Pull Request Checker
on:
pull_request_target:
types:
- opened
- reopened
branches:
- main

jobs:
check-pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const isTitleValid = /^\[#\d+\] /.test(pr.data.title)
const isDescriptionValid = /([Ff]ix(es|ed)?|[Cc]lose(s|d)?|[Rr]esolve(s|d)?|[Pp]art [Oo]f) \(.*\)\[.*\]/.test(pr.data.body)
if (isTitleValid && isDescriptionValid) {
return
}
let body = `Hi @${pr.data.user.login}, thank you for your interest in contributing to PyHPCC!
However, your PR does not appear to follow our [contribution guidelines](CONTRIBUTING.md):\n\n`
if (!isTitleValid) {
body += "- Title must start with the issue number the PR is fixing in square brackets, e.g. `[#<issue-number>]`\n"
}
if (!isDescriptionValid) {
body += "- Description must reference the issue number the PR is fixing, e.g. `Fixes #<issue-number>` (or `Part of #<issue-number>` if the PR does not address the issue fully)\n"
}
body += "\nPlease address the above before we proceed to review your PR."
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
})

0 comments on commit afcd26d

Please sign in to comment.