Skip to content

Commit 749a8b0

Browse files
github-actions[bot]Jack Plowman
authored andcommitted
DI-449 Update and add Github Pull Request Checklists (#358)
* Add basic template to be used when action runs * Update task and test PR templates * Simplify Workflow to use single file * Experiment with environment variables * Add test branches to regex * Reword template files Co-authored-by: Jack Plowman <jack.plowman1@nhs.net>
1 parent 2646d50 commit 749a8b0

3 files changed

Lines changed: 64 additions & 21 deletions

File tree

.github/pull_request_template.md renamed to .github/pull-request-templates/task_pull_request_template.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
1-
## Link to JIRA Ticket
1+
# Task Branch Pull Request
22

3-
-
3+
**<https://nhsd-jira.digital.nhs.uk/browse/{{ .BRANCH_NUMBER }}>**
44

5-
## Description
5+
## Description of Changes
66

77
Please include a summary of the change
88

9-
### Noteworthy Changes
10-
11-
- These are changes the reviewer should look out for
12-
139
## Type of change
1410

1511
Delete not appropriate
1612

1713
- Bug fix (non-breaking change which fixes an issue)
1814
- New feature (non-breaking change which adds functionality)
1915
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
20-
- This change requires a documentation update
21-
22-
## Testing
16+
- Refactoring (non-breaking change which improves the structure of the code)
2317

24-
Please tick the testing that has been completed
25-
26-
- [ ] Unit tests
27-
- [ ] Integration tests
28-
29-
## Developer Checklist
18+
## Development Checklist
3019

3120
- [ ] I have performed a self-review of my own code
3221
- [ ] I have run the [code formatting checks](../README.md#code-quality)
3322
- [ ] I have run the [code quality checks](../README.md#code-quality)
3423
- [ ] New code meets [standards](https://nhsd-confluence.digital.nhs.uk/display/DI/DI+Ways+of+Working) agreed by the team
35-
- [ ] Unit test code coverage is at or above 80%
36-
- [ ] New and existing unit tests pass locally with my changes
3724
- [ ] Tests have added that prove my fix is effective or that my feature works (Integration tests)
38-
- [ ] I have made corresponding changes to the documentation
3925
- [ ] I have updated Dependabot to include my changes (if applicable)
4026

4127
## Code Reviewer Checklist
4228

43-
- [ ] I have run the unit tests and they run correctly
4429
- [ ] I can confirm the changes have been tested or approved by a tester
45-
- [ ] I can confirm no remaining infrastructure is left over from this branch
4630
- [ ] I have checked any ignore commands for code linting tools and I agree that the code is safe
31+
32+
**Note: Please don't approve your own pull requests if avoidable.**
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Test Branch Pull Request
2+
3+
## What branch do these tests check?
4+
5+
-
6+
7+
## Description of changes/tests
8+
9+
Why do these tests need to exist?/When should the test be run?
10+
11+
## Development Checklist
12+
13+
- [ ] The tests are tagged correctly
14+
- [ ] The tests will be run in the development pipeline
15+
- [ ] The tests are stable and pass
16+
- [ ] I have used reusable functions and classes where possible
17+
18+
## Code Reviewer Checklist
19+
20+
- [ ] I am confident the tests are stable and have passed
21+
- [ ] I am confident the tests will be run in the development pipeline
22+
- [ ] I believe the tests developed in a way which makes them reusable and maintainable
23+
24+
**Note: Please don't approve your own pull requests if avoidable.**
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Create Pull Requests"
2+
on:
3+
push:
4+
branches:
5+
- "task/*"
6+
- "test/*"
7+
8+
jobs:
9+
pull-request:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Get branch number
15+
run: echo "BRANCH_NUMBER=$(echo ${{ github.ref_name }} | grep -Eo '[A-Za-z]{2,5}-[0-9]{1,5}')" >> $GITHUB_ENV
16+
- name: Get branch designator
17+
run: echo "BRANCH_DESIGNATOR=$(echo ${{ github.ref_name }} | sed 's|/.*||')" >> $GITHUB_ENV
18+
- name: Render Pull Request template
19+
id: template
20+
uses: chuhlomin/render-template@v1.4
21+
with:
22+
template: .github/pull-request-templates/${{ env.BRANCH_DESIGNATOR }}_pull_request_template.md
23+
vars: |
24+
BRANCH_NUMBER: ${{ env.BRANCH_NUMBER }}
25+
BRANCH_DESIGNATOR: ${{ env.BRANCH_DESIGNATOR }}
26+
- name: Create Pull Request
27+
uses: repo-sync/pull-request@v2
28+
with:
29+
destination_branch: "develop"
30+
pr_title: "${{ github.ref_name }} into develop"
31+
pr_body: ${{ steps.template.outputs.result }}
32+
pr_draft: true
33+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)