Skip to content

Commit 27b6d1a

Browse files
authored
Update PR template and add checklist workflow (#162)
* Update PR template * Add PR checklist worklfow * Update template
1 parent c0765de commit 27b6d1a

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

Diff for: .github/pull_request_template.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Description
2+
3+
_Add a comprehensive description of proposed changes_
4+
5+
_List associated issue number(s) if exist(s): #6 (for example)_
6+
7+
_Documentation PR (if needed): #1340 (for example)_
8+
9+
---
10+
11+
PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
12+
This approach ensures that reviewers don't spend extra time asking for regular requirements.
13+
14+
You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
15+
16+
Checklist to comply with **before moving PR from draft**:
17+
18+
**PR completeness and readability**
19+
20+
- [ ] I have reviewed my changes thoroughly before submitting this pull request.
21+
- [ ] I have commented my code, particularly in hard-to-understand areas.
22+
- [ ] I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
23+
- [ ] Git commit message contains an appropriate signed-off-by string _(see [CONTRIBUTING.md](https://github.com/intel/scikit-learn-intelex/blob/main/CONTRIBUTING.md#pull-requests) for details)_.
24+
- [ ] I have added a respective label(s) to PR if I have a permission for that.
25+
- [ ] I have resolved any merge conflicts that might occur with the base branch.
26+
27+
**Testing**
28+
29+
- [ ] I have run it locally and tested the changes extensively.
30+
- [ ] All CI jobs are green or I have provided justification why they aren't.
31+
- [ ] I have extended testing suite if new functionality was introduced in this PR.

Diff for: .github/workflows/pr-checklist.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#===============================================================================
2+
# Copyright 2024 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#===============================================================================
16+
17+
name: Check PR Checklist
18+
19+
on:
20+
pull_request:
21+
types: [opened, edited, synchronize, ready_for_review, converted_to_draft]
22+
23+
permissions:
24+
contents: read
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.number || github.sha }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
checklist:
32+
name: Close all checkboxes before moving from draft
33+
timeout-minutes: 5
34+
runs-on: ubuntu-24.04
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Get pull request details
39+
id: pr
40+
uses: actions/github-script@v7
41+
with:
42+
script: |
43+
const pr_desc = await github.rest.pulls.get({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
pull_number: context.payload.pull_request.number
47+
});
48+
core.setOutput('body', pr_desc.data.body)
49+
core.setOutput('draft', pr_desc.data.draft)
50+
core.setOutput('author_type', pr_desc.data.user.type)
51+
- name: Check if all checkboxes are checked
52+
id: checkboxes
53+
env:
54+
DESCRIPTION: ${{ steps.pr.outputs.body }}
55+
run: |
56+
UNCHECKED=$(echo "$DESCRIPTION" | grep -c '\[ \]' || true)
57+
echo "unchecked=$UNCHECKED" >> $GITHUB_OUTPUT
58+
- name: Fail if not all checkboxes are checked, PR is not draft and author is not a bot
59+
if: ${{ (steps.pr.outputs.draft == 'false') && (steps.checkboxes.outputs.unchecked != '0') && (steps.pr.outputs.author_type != 'Bot') }}
60+
run: |
61+
echo "Unchecked checkboxes: ${{ steps.checkboxes.outputs.unchecked }}"
62+
exit 1

0 commit comments

Comments
 (0)