forked from alibaba/GraphScope
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add conventional checks for PR title and docs (alibaba#3054)
With this PR merged, new checks are introduced: the PR titles should follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/), which in the format of <type>(<scope>): <description>. e.g., - fix: Correct typo - feat(interactive): Add support for g.V().outE().inV() - refactor!: Drop support for Python 3.8 - feat(analytical): Add delta-version for PageRank if the PR is in type of `feat(<scope>):`, then documentation must be updated.
- Loading branch information
1 parent
ac6a760
commit 5cdb50a
Showing
2 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: PR-Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
conventional-pr-check: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- uses: amannn/action-semantic-pull-request@v5 | ||
id: pr-convention | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# Types allowed (newline-delimited). | ||
# Default: https://github.com/commitizen/conventional-commit-types | ||
types: | | ||
build | ||
ci | ||
docs | ||
feat | ||
fix | ||
perf | ||
refactor | ||
test | ||
chore | ||
# Scopes allowed (newline-delimited). | ||
scopes: | | ||
core | ||
python | ||
k8s | ||
coordinator | ||
one | ||
interactive | ||
insight | ||
analytical | ||
learning | ||
# A scope can be not provided. | ||
requireScope: false | ||
disallowScopes: | | ||
release | ||
[A-Z]+ | ||
# If the PR contains one of these newline-delimited labels, the | ||
# validation is skipped. | ||
ignoreLabels: | | ||
bot | ||
ignore-semantic-pull-request | ||
feature-docs-check: | ||
runs-on: ubuntu-20.04 | ||
needs: conventional-pr-check | ||
steps: | ||
- uses: dorny/paths-filter@v2 | ||
id: doc-changes | ||
with: | ||
filters: | | ||
src: | ||
- 'docs/**' | ||
- uses: actions-ecosystem/action-regex-match@v2 | ||
id: pr-regex-match | ||
with: | ||
text: ${{ github.event.pull_request.title }} | ||
regex: 'feat.*' | ||
|
||
- if: ${{ steps.pr-regex-match.outputs.match != '' && steps.doc-changes.outputs.src == 'false' }} | ||
run: | | ||
# echo "title=${{ github.event.pull_request.title }}" | ||
# echo "steps.pr-regex-match.outputs.match=${{ steps.pr-regex-match.outputs.match }}" | ||
# echo "steps.doc-changes.outputs.src=${{ steps.doc-changes.outputs.src }}" | ||
echo " ❌ Uh oh! ❌ \n | ||
We suggest that a PR with type @feat should has corresponding documentations. \n | ||
If you believe this PR could be merged without documentation, please add @yecol as an extra reviewer for confirmation." | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters