Skip to content

Commit

Permalink
chore: Add PR checker workflow (#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcreaser committed Dec 20, 2022
1 parent f6508d8 commit 3818cc7
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/pr-title-checker-config.json
@@ -0,0 +1,17 @@
{
"LABEL": {
"name": "Title Needs Formatting",
"color": "FF5733"
},
"CHECKS": {
"prefixes": ["chore: ", "refactor: ", "perf: ", "test: ", "docs: "],
"regexp": "(fix|feat)\\((all|analytics|api|auth|core|datastore|geo|predictions|storage)\\): ",
"regexpFlags": "",
"ignoreLabels" : []
},
"MESSAGES": {
"success": "All OK",
"failure": "Your title is not formatted correctly. Please see https://github.com/aws-amplify/amplify-android/blob/main/CONTRIBUTING.md#pull-request-guidelines for guidelines.",
"notice": ""
}
}
21 changes: 21 additions & 0 deletions .github/workflows/pr_title_checker.yml
@@ -0,0 +1,21 @@
# Runs a check to verify PRs have a valid title

name: "PR Title Checker"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.3.5
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: ".github/pr-title-checker-config.json"
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -428,10 +428,20 @@ Copy-paste this, and complete the workflow in the UI. It will invite you to
### Pull Request Guidelines
- The title of your PR must be descriptive to the specific change.
- The title of your PR must be of below format since next release version is determined from PR titles in the commit history.
- For a bugfix: `fix(category): description of changes`
- For a feature: `feat(catgory): add awesome feature`
- Everything else: `chore: fix build script`
- Eg. `fix(auth): throw correct auth exception for code mismatch`. Refer https://github.com/aws-amplify/amplify-android/pull/1370
- For a bugfix: `fix(category): description of changes`
- For a feature: `feat(catgory): add awesome feature`
- Everything else: `chore: fix build script`
- Valid categories are:
- all
- analytics
- api
- auth
- core
- datastore
- geo
- predictions
- storage
- Eg. `fix(auth): throw correct auth exception for code mismatch`. Refer https://github.com/aws-amplify/amplify-android/pull/1370
- No period at the end of the title.
- Pull Request message should indicate which issues are fixed: `fixes #<issue>` or `closes #<issue>`.
- If not obvious (i.e. from unit tests), describe how you verified that your change works.
Expand Down

0 comments on commit 3818cc7

Please sign in to comment.