Skip to content

Commit 75cf053

Browse files
authored
[ci] [workflow] Add license check, semantic pr title and issue sync workflows (#9)
* ci: license check for __tests__ and src * ci: license check on ci/** * feat: update eslint plugin dep * fix: apache/skywalking-eyes/header use * ci: issues sync and semantic pr title * feat: update readme * ci: disable codecov github checks
1 parent a885d94 commit 75cf053

File tree

12 files changed

+152
-24
lines changed

12 files changed

+152
-24
lines changed

.github/.licenserc.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
header:
2+
license:
3+
spdx-id: MIT
4+
pattern: |
5+
Copyright (c) \d{4} Bytedance Ltd. and/or its affiliates
6+
SPDX-License-Identifier: MIT
7+
8+
paths:
9+
- packages/*/{src,__tests__}/**/*.{ts,tsx,less,css}
10+
11+
paths-ignore:
12+
- 'node_modules'
13+
- 'dist'
14+
- 'coverage'
15+
- 'licenses'
16+
- '**/*.md'
17+
- '**/__mock__/**'
18+
19+
comment: on-failure

.github/workflows/ci.yml renamed to .github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: CI
2+
23
on:
34
push:
4-
branches: ['ci/**']
5+
branches: ['ci/**', 'main']
56
pull_request:
67
branches: ['main']
78
workflow_dispatch:
9+
810
jobs:
911
build:
12+
name: Build and Test
1013
runs-on: ubuntu-latest
1114
env:
1215
NODE_VERSION: '18'

.github/workflows/issue-sync.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Issue Notification
2+
3+
on:
4+
issues:
5+
types: ['opened', 'reopened', 'closed']
6+
7+
jobs:
8+
sync:
9+
name: Sync Issues
10+
runs-on: ubuntu-latest
11+
env:
12+
NODE_VERSION: '18'
13+
LARK_APP_ID: ${{ secrets.COZELOOP_LARK_APP_ID }}
14+
LARK_APP_SECRET: ${{ secrets.COZELOOP_LARK_APP_SECRET }}
15+
ISSUE_ACTION: ${{ github.event.action }}
16+
ISSUE_NUMBER: ${{ github.event.issue.number }}
17+
ISSUE_URL: ${{ github.event.issue.html_url }}
18+
ISSUE_TITLE: ${{ github.event.issue.title }}
19+
ISSUE_BODY: ${{ github.event.issue.body }}
20+
REPO_NAME: ${{ github.repository }}
21+
22+
steps:
23+
- name: Setup Node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Install ci-tools
29+
run: |
30+
npm install -g @cozeloop/ci-tools@0.0.1
31+
32+
- name: Notify via lark
33+
run: |
34+
cozeloop-ci lark sync-issue \
35+
--email qihai@bytedance.com
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: License Check
2+
3+
on:
4+
push:
5+
branches: ['ci/**', 'main']
6+
pull_request:
7+
branches: ['main']
8+
workflow_dispatch:
9+
10+
jobs:
11+
license-check:
12+
name: License Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 1
19+
20+
- name: Check License Header
21+
uses: apache/skywalking-eyes/header@v0.7.0
22+
with:
23+
config: .github/.licenserc.yaml
24+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Semantic Pull Request
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
main:
16+
name: Check Pull Request Title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v5.5.2
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
# see https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type
24+
types: |
25+
build
26+
ci
27+
docs
28+
feat
29+
fix
30+
perf
31+
refactor
32+
style
33+
test
34+
chore
35+
# sdk: cozeloop-ai, cozeloop-langchain, etc
36+
# infra: rush update, {eslint,ts,vitest}-config, prettier etc
37+
# tools: ci-tools, etc
38+
# workflow: gh workflow
39+
scopes: |
40+
sdk
41+
infra
42+
tools
43+
workflow
44+
# The pull request's title should be fulfilled the following pattern:
45+
#
46+
# [<type>][<optional scope>] <description>
47+
#
48+
# ... where valid types and scopes can be found above; for example:
49+
#
50+
# [fix][test] flaky test V1_ProxyAuthenticationTest.anonymousSocketTest
51+
headerPattern: '^\[(\w*?)\](?:\[(.*?)\])?(?:\s*)(.*)$'
52+
headerPatternCorrespondence: type, scope, subject

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This monorepo contains the following packages:
1212
| Package | Description | Version |
1313
|---------|------------|---------|
1414
| [@cozeloop/ai](./packages/cozeloop-ai) | CozeLoop API SDK | [![npm](https://img.shields.io/npm/v/@cozeloop/ai.svg)](https://www.npmjs.com/package/@cozeloop/ai) |
15+
| [@cozeloop/langchain](./packages/cozeloop-langchain) | CozeLoop LangChain Integration | [![npm](https://img.shields.io/npm/v/@cozeloop/langchain.svg)](https://www.npmjs.com/package/@cozeloop/langchain) |
1516

1617

1718
## 🎮 Examples

README.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| 包名 | 描述 | 版本 |
1313
|---------|------------|---------|
1414
| [@cozeloop/ai](./packages/cozeloop-ai) | CozeLoop API SDK | [![npm](https://img.shields.io/npm/v/@cozeloop/ai.svg)](https://www.npmjs.com/package/@cozeloop/ai) |
15+
| [@cozeloop/langchain](./packages/cozeloop-langchain) | CozeLoop LangChain Integration | [![npm](https://img.shields.io/npm/v/@cozeloop/langchain.svg)](https://www.npmjs.com/package/@cozeloop/langchain) |
1516

1617

1718
## 🎮 示例

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ coverage:
1717
target: 80%
1818
threshold: 5%
1919

20+
github_checks:
21+
annotations: false
22+
2023
comment:
2124
layout: 'header, diff, components, files' # show component info in the PR comment
2225
require_changes: false # if true: only post the comment if coverage changes

common/config/rush/pnpm-lock.yaml

Lines changed: 8 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/eslint-config/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
"eslint-plugin-prettier": "~5.2.1",
5656
"eslint-plugin-promise": "^5.1.0",
5757
"eslint-plugin-react": "~7.37.1",
58-
"eslint-plugin-react-hooks": "5.1.0-beta-26f2496093-20240514",
59-
"eslint-plugin-redux-saga": "^1.1.0",
58+
"eslint-plugin-react-hooks": "^5.2.0",
6059
"eslint-plugin-risxss": "~2.1.0",
6160
"eslint-plugin-security": "3.0.1",
6261
"eslint-plugin-unicorn": "48.0.1",

0 commit comments

Comments
 (0)