From 9125601e699c4f52f8a0d473924c5246d7f90476 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Wed, 5 Oct 2022 13:20:38 -0500 Subject: [PATCH] build(ci): improve PR process (#1015) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This PR improves the overall PR creation and checking process. Particularly it includes the following changes: - improved the `PULL_REQUEST_TEMPLATE` to have more meaningful checkboxes that the author needs to check - added a GitHub workflow to make sure that PR titles follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification ## Checklist - [ ] Ran Linting - [ ] Targeted PR against correct branch. - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Wrote unit tests. - [ ] Added an entry to the `CHANGELOG.md` file. - [ ] Re-reviewed `Files changed` in the Github PR explorer. --- .github/PULL_REQUEST_TEMPLATE.md | 24 ++++++++++++++++++++++++ .github/pull_request_template.md | 17 ----------------- .github/workflows/lint-pr.yml | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..6688fc2e1a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Description + +Closes: #XXXX + + + +--- + +### Author Checklist + +*All items are required. Please add a note to the item if the item is not applicable and +please add links to any relevant follow up issues.* + +I have... + +- [ ] ran linting +- [ ] wrote tests where necessary +- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title +- [ ] targeted the correct branch +- [ ] provided a link to the relevant issue or specification +- [ ] reviewed "Files changed" and left comments if necessary +- [ ] confirmed all CI checks have passed +- [ ] added an entry to the `CHANGELOG.md` file \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index dd28bcc46c..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,17 +0,0 @@ - - -## Description - - - -## Checklist -- [ ] Ran Linting -- [ ] Targeted PR against correct branch. -- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. -- [ ] Wrote unit tests. -- [ ] Added an entry to the `CHANGELOG.md` file. -- [ ] Re-reviewed `Files changed` in the Github PR explorer. diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000000..912e3a4b20 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,20 @@ +name: "Lint PR" +# Lint PR workflow runs linting over a single PR in order to make sure that the title respects +# the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. +# This workflow is run every time a PR is opened, edited or updated somehow. + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + Lint: + runs-on: ubuntu-latest + steps: + - name: Run lint ✅ + uses: amannn/action-semantic-pull-request@v4.5.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file