Skip to content

Commit

Permalink
misc: improved pull request template, less checkboxes - auto close ma…
Browse files Browse the repository at this point in the history
…ster PRs with action (#868)
  • Loading branch information
braindigitalis authored Sep 20, 2023
1 parent ee26853 commit 0451361
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 60 deletions.
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/code_change_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ Please outline your change here. Be sure to check the checkboxes below. ]

## Code change checklist

- [ ] I have ensured that all methods and functions are **fully documented** using doxygen style comments
- [ ] My code follows the [coding style guide](https://dpp.dev/coding-standards.html).
- [ ] I tested that my change works before raising the PR.
- [ ] I have ensured that I did not break any existing API calls.
- [ ] I have not built my pull request using AI, a static analysis tool or similar without any human oversight.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/docs_change_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ Please outline your change here. Be sure to check the checkboxes below. ]

## Documentation change checklist

- [ ] My documentation changes follow the same style as the rest of the documentation and any examples follow the [coding style guide](https://dpp.dev/coding-standards.html).
- [ ] I tested that my change works before raising the PR (via running `oxygen`, and testing examples).
- [ ] I have not moved any existing pages or changed any existing URLs without strong justification as to why.
- [ ] I have not generated content using AI or a desktop utility such as grammarly.
10 changes: 3 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
- [ ] My pull request is made against the `dev` branch.
- [ ] I have ensured that the changed library can be built on your target system. I did not introduce any platform-specific code.
- [ ] I have ensured that all methods and functions are **fully documented** using doxygen style comments.
- [ ] I tested my commits, by adding a test case to the unit tests if needed
- [ ] I have ensured that I did not break any existing API calls.
- [ ] My code follows the [coding style guide](https://dpp.dev/coding-standards.html) (if you are not sure, match the code style of existing files including indent style etc).
- [ ] I have not built my pull request using AI, a static analysis tool or similar without any human oversight. Where I have generated this pull request using a tool, I have justified why this is needed.
Please go the the `Preview` tab and select the appropriate pull request template for your changes:

* [Code Changes](?expand=1&template=code_change_template.md)
* [Documentation Changes](?expand=1&template=docs_change_template.md)
29 changes: 7 additions & 22 deletions .github/workflows/target-master.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
name: Close master-targeted PRs
on:
pull_request:
pull_request_target:
types: [opened]
branches:
- 'master'

jobs:
docs:
name: PR Check
runs-on: ubuntu-20.04

concurrency:
group: pr
cancel-in-progress: true

run:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit

- name: Setup PHP
uses: shivammathur/setup-php@72ae4ccbe57f82bbe08411e84e2130bd4ba1c10f # v2
- name: Close PRs
uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 # v3.1.2
with:
php-version: '8.0'

- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
submodules: recursive

- name: Close master target PRs
run: php buildtools/close-master-pr.php
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment: "Thank you for your contribution, but PRs must be raised against the `dev` branch. Please log your pull request against the `dev` branch not `master`. You can also retarget this pull request, then reopen it."

31 changes: 0 additions & 31 deletions buildtools/close-master-pr.php

This file was deleted.

0 comments on commit 0451361

Please sign in to comment.