Skip to content

chore: Add PR checker workflow #2188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/pr-title-checker-config.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
Original file line number Diff line number Diff line change
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