From 0923a56e4c7a53ce37f2ad237b1024702bba37c0 Mon Sep 17 00:00:00 2001
From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com>
Date: Mon, 24 Jul 2023 20:38:07 +0800
Subject: [PATCH] feat: add file:
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
.github/workflows/cla.yml | 4 +--
.github/workflows/pull-request.yml | 39 +++++++++++++++++++++++++++
docs/CODEOWNERS | 42 +++++++++++++++---------------
scripts/githooks/commit-msg | 2 +-
scripts/githooks/pre-commit | 2 +-
5 files changed, 64 insertions(+), 25 deletions(-)
create mode 100644 .github/workflows/pull-request.yml
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
index 5776a47be..603a49399 100644
--- a/.github/workflows/cla.yml
+++ b/.github/workflows/cla.yml
@@ -41,8 +41,8 @@ jobs:
remote-repository-name: ${{ env.REMOTE_REPOSITORY }}
create-file-commit-message: '📚 Docs: Creating file for storing ${{ github.event.repository.name }} CLA Signatures'
- custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md).
If you wish to sign the CRA, **please comment on this sentence:**'
+ custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md).
If you wish to sign the CRA, **Please copy and comment on the following sentence:**'
custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA'
- custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).
The signed information is recorded [🤖here](https://github.com/openim-sigs/cla/tree/main/signatures/${{ env.OPEN_IM_SERVER_ALLOWLIST }}/cla.json)'
+ custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).
The signed information is recorded [🤖here](https://github.com/openim-sigs/cla/tree/main/signatures/${{ github.event.repository.name }}/cla.json)'
# lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
# use-dco-flag: true - If you are using DCO instead of CLA
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
new file mode 100644
index 000000000..726d57e14
--- /dev/null
+++ b/.github/workflows/pull-request.yml
@@ -0,0 +1,39 @@
+name: Github Pull Request
+on:
+ push:
+ branches: [main]
+ paths-ignore:
+ - 'README.md'
+ - 'CONTRIBUTING.md'
+
+ - 'docs/**'
+ pull_request:
+ branches: [main]
+ paths-ignore:
+ - 'README.md'
+ - 'CONTRIBUTING.md'
+ - 'docs/**'
+
+permissions:
+ pull-requests: write
+ contents: write
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v5
+ with:
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ commit-message: 'build: update distribution'
+ title: 'build: update distribution'
+ body: |
+ - Updates the distribution for changes on `main`
+
+ Auto-generated by [create-pull-request][1]
+
+ [1]: https://github.com/OpenIMSDK/Open-IM-Sever
+ branch: 'bot/update-distribution'
\ No newline at end of file
diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS
index 3cfc940e3..a05a1866b 100644
--- a/docs/CODEOWNERS
+++ b/docs/CODEOWNERS
@@ -2,28 +2,28 @@
# Each line is a file pattern followed by one or more owners.
# README files
-README.md @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+README.md @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Contributing guidelines
-CONTRIBUTING.md @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+CONTRIBUTING.md @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# License files
-LICENSE @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+LICENSE @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Makefile
-Makefile @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+Makefile @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
-# @cubxxw and @kubbot will be requested for
+# @cubxxw and @openimsdk/bot will be requested for
# review when someone opens a pull request.
-* @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+* @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
-*.js @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+*.js @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
@@ -35,16 +35,16 @@ Makefile @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the OpenIMSDK team in the github organization owns all .txt files.
-*.txt @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
+*.txt @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
-docs/* 3293172751nss@gmail.com @kubbot @skiffer-git
+docs/* 3293172751nss@gmail.com @openimsdk/bot @skiffer-git
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
-api/ @cubxxw @IRONICBo @skiffer-git
+api/ @openimsdk/openim @cubxxw @skiffer-git
# This is a comment.
# Each line is a file pattern followed by one or more owners.
@@ -65,24 +65,24 @@ cmd/*
config/* @skiffer-git
# db directory
-db/sdk @77caleb @BanTanger @cubxxw @Gordon
+db/sdk @BanTanger @cubxxw @Gordon
# internal directory
-internal/ @skiffer-git @FGadvancer
+internal/ @openimsdk/openim @skiffer-git @FGadvancer
# logs directory
-logs/* @skiffer-git @FGadvancer
+logs/* @skiffer-git @FGadvancer
# pkg directory
-pkg/a2r @skiffer-git
+pkg/a2r @openimsdk/openim @skiffer-git @cubxxw @openimsdk/bot
# scripts directory
-scripts/LICENSE/* @cubxxw @skiffer-git @FGadvancer
-scripts/enterprise/* @FGadvancer @cubxxw @skiffer-git @kubbot
-scripts/githooks/* @cubxxw @skiffer-git @FGadvancer
-scripts/lib/* @FGadvancer @cubxxw @skiffer-git @kubbot
-scripts/make-rules/* @FGadvancer @cubxxw @skiffer-git @kubbot
+scripts/LICENSE/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
+scripts/enterprise/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
+scripts/githooks/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
+scripts/lib/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
+scripts/make-rules/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
# test directory
-test/mongo @FGadvancer @cubxxw @skiffer-git @kubbot
-test/mysql @FGadvancer @cubxxw @skiffer-git @kubbot
+test/mongo @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
+test/mysql @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg
index 99f4067b9..efff13fd0 100644
--- a/scripts/githooks/commit-msg
+++ b/scripts/githooks/commit-msg
@@ -61,7 +61,7 @@ GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint"
$GITLINT_DIR \
--msg-file=$1 \
- --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
+ --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \
--subject-maxlen=150 \
--subject-minlen=10 \
--body-regex=".*" \
diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit
index cad60e163..91f5ad531 100644
--- a/scripts/githooks/pre-commit
+++ b/scripts/githooks/pre-commit
@@ -26,7 +26,7 @@
LC_ALL=C
local_branch="$(git rev-parse --abbrev-ref HEAD)"
-valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
+valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|bot|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
YELLOW="\e[93m"
GREEN="\e[32m"