Skip to content

Commit 62c1b62

Browse files
authored
[ci] [workflow] frontend ci with changed-files action (#28)
* ci: pr sync * doc: update readme banner * ci: tsc with action changed-files * ci: ci with action changed-files * doc: readme line break * doc: readme - join group * doc: readme.cn
1 parent ff5a253 commit 62c1b62

8 files changed

Lines changed: 72 additions & 75 deletions

File tree

.github/scripts/branch-diff.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/frontend-ci.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151
${{ runner.os }}-rush-store-main
5252
${{ runner.os }}-rush-store
5353
54-
- name: Branch Diff
55-
id: branch-diff
56-
run: |
57-
TARGET_BRANCH="${GITHUB_BASE_REF:-main}"
58-
git fetch origin $TARGET_BRANCH
59-
sh .github/scripts/branch-diff.sh origin/$TARGET_BRANCH > changed.json
60-
echo "file=changed.json" >> "$GITHUB_OUTPUT"
54+
- name: Changed Files
55+
uses: tj-actions/changed-files@v46.0.5
56+
with:
57+
files: |
58+
frontend/**
59+
json: true
60+
write_output_files: true
6161

6262
- name: Install Dependencies
6363
run: |
@@ -69,5 +69,5 @@ jobs:
6969
7070
- name: Lint & Style
7171
run: |
72-
node common/scripts/install-run-rush.js increment --action lint -p ${{ steps.branch-diff.outputs.file }}
73-
node common/scripts/install-run-rush.js increment --action style -p ${{ steps.branch-diff.outputs.file }}
72+
node common/scripts/install-run-rush.js increment --action lint -p .github/outputs/all_changed_files.json
73+
node common/scripts/install-run-rush.js increment --action style -p .github/outputs/all_changed_files.json

.github/workflows/frontend-tsc-ci.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ jobs:
5050
${{ runner.os }}-rush-store-main
5151
${{ runner.os }}-rush-store
5252
53-
- name: Branch Diff
54-
id: branch-diff
55-
run: |
56-
TARGET_BRANCH="${GITHUB_BASE_REF:-main}"
57-
git fetch origin $TARGET_BRANCH
58-
sh .github/scripts/branch-diff.sh origin/$TARGET_BRANCH > changed.json
59-
echo "file=changed.json" >> "$GITHUB_OUTPUT"
53+
- name: Changed Files
54+
uses: tj-actions/changed-files@v46.0.5
55+
with:
56+
files: |
57+
frontend/**
58+
json: true
59+
write_output_files: true
6060

6161
- name: Install Dependencies
6262
run: |
63-
node common/scripts/install-run-rush.js increment --action install -p ${{ steps.branch-diff.outputs.file }}
63+
node common/scripts/install-run-rush.js increment --action install -p .github/outputs/all_changed_files.json
6464
6565
- name: Prepare Basic Packages
6666
run: |
6767
node common/scripts/install-run-rush.js pre-build -v
6868
6969
- name: TS Check
7070
run: |
71-
node common/scripts/install-run-rush.js increment --action ts-check -p ${{ steps.branch-diff.outputs.file }}
71+
node common/scripts/install-run-rush.js increment --action ts-check -p .github/outputs/all_changed_files.json

.github/workflows/issue-sync.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Install ci-tools
2929
run: |
30-
npm install -g @cozeloop/ci-tools@0.0.1
30+
npm install -g @cozeloop/ci-tools@0.0.4
3131
3232
- name: Notify via lark
3333
run: |

.github/workflows/pr-sync.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR Notification
2+
3+
on:
4+
pull_request:
5+
types: ['opened', 'reopened', 'closed']
6+
7+
jobs:
8+
sync:
9+
name: Send Lark Message
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+
REPO_NAME: ${{ github.repository }}
16+
PR_ACTION: ${{ github.event.action }}
17+
PR_URL: ${{ github.event.pull_request.html_url }}
18+
PR_NUMBER: ${{ github.event.pull_request.number }}
19+
PR_TITLE: ${{ github.event.pull_request.title }}
20+
PR_SENDER: ${{ github.event.sender.login }}
21+
PR_SOURCE_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
22+
PR_SOURCE_REF: ${{ github.event.pull_request.head.ref }}
23+
PR_TARGET_OWNER: ${{ github.event.pull_request.base.repo.owner.login }}
24+
PR_TARGET_REF: ${{ github.event.pull_request.base.ref }}
25+
PR_MERGED: ${{ github.event.pull_request.merged }}
26+
27+
steps:
28+
- name: Setup Node
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: ${{ env.NODE_VERSION }}
32+
33+
- name: Install ci-tools
34+
run: |
35+
npm install -g @cozeloop/ci-tools@0.0.4
36+
37+
- name: Notify via lark
38+
run: |
39+
cozeloop-ci lark sync-pr \
40+
--chat-id oc_d02b85f9799a0c35cf164d3a939ef30e

README.cn.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/0fe1a642aae842c298076335b6a393bf~tplv-goo7wpa0wc-image.image)
1+
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/11faa43b83754c089d2ec953306d3e63~tplv-goo7wpa0wc-image.image)
22

33
<div align="center">
44
<p>
@@ -33,7 +33,7 @@ Coze Loop 通过提供全生命周期的管理能力,帮助开发者更高效
3333

3434
| **功能** | **功能点** |
3535
| --- | --- |
36-
| Prompt 调试 | * Playground 调试、对比 <br> * Prompt 版本管理 |
36+
| Prompt 调试 | * Playground 调试、对比 <br> * Prompt 版本管理 |
3737
| 评测 | * 管理评测集 <br> * 管理评估器 <br> * 管理实验 |
3838
| 观测 | * SDK 上报 Trace <br> * Trace 数据观测 |
3939
| 模型 | 支持接入 OpenAI、火山方舟等模型 |
@@ -99,16 +99,13 @@ Coze Loop 通过提供全生命周期的管理能力,帮助开发者更高效
9999
### 技术交流与讨论
100100
加入我们的技术交流群,与其他开发者分享经验、获取项目最新动态:
101101

102-
**飞书群聊**
103-
飞书移动端扫描以下二维码,加入Coze Loop 技术交流群。
102+
* 飞书群聊:飞书移动端扫描以下二维码,加入Coze Loop 技术交流群。
104103

105104
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/818dd6ec45d24041873ca101681186c1~tplv-goo7wpa0wc-image.image)
106105

107-
**Discord 服务器**
108-
点击加入:[Coze Community](https://discord.gg/a6YtkysB)
106+
* Discord 服务器:[Coze Community](https://discord.gg/a6YtkysB)
109107

110-
**Telegram 群组**
111-
点击加入:Telegram Group [Coze](https://t.me/+pP9CkPnomDA0Mjgx)
108+
* Telegram 群组:[Coze](https://t.me/+pP9CkPnomDA0Mjgx)
112109

113110
## 致谢
114111
感谢所有为 Coze Loop 项目做出贡献的开发者和社区成员。特别感谢:

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/0fe1a642aae842c298076335b6a393bf~tplv-goo7wpa0wc-image.image)
1+
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/11faa43b83754c089d2ec953306d3e63~tplv-goo7wpa0wc-image.image)
22

33

44
<div align="center">
@@ -103,16 +103,13 @@ To efficiently track and resolve issues while ensuring transparency and collabor
103103
### Technical Discussion & Communication
104104
Join our technical discussion groups to share experiences with other developers and stay updated with the latest project developments:
105105

106-
**Feishu Group Chat**
107-
Scan the QR code below on the Lark mobile app to join the Coze Loop technical discussion group
106+
* Lark Group Chat: Scan the QR code below on the Lark mobile app to join the Coze Loop technical discussion group.
108107

109108
![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/818dd6ec45d24041873ca101681186c1~tplv-goo7wpa0wc-image.image)
110109

111-
**Discord Server**
112-
Click to join: [Coze Community](https://discord.gg/a6YtkysB)
110+
* Discord Server: [Coze Community](https://discord.gg/a6YtkysB)
113111

114-
**Telegram Group**
115-
Click to join: Telegram Group [Coze](https://t.me/+pP9CkPnomDA0Mjgx)
112+
* Telegram Group: [Coze](https://t.me/+pP9CkPnomDA0Mjgx)
116113

117114
## Acknowledgments
118115
Thanks to all developers and community members who contributed to the Coze Loop project Special thanks:

frontend/apps/cozeloop/src/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@ import { pullFeatureFlags, type FEATURE_FLAGS } from '@coze-arch/bot-flags';
77

88
import { App } from './app';
99

10-
const initFlags = () => {
11-
pullFeatureFlags({
12-
timeout: 1000 * 4,
13-
fetchFeatureGating: () => Promise.resolve({} as unknown as FEATURE_FLAGS),
14-
});
15-
};
16-
1710
export async function render() {
1811
await Promise.all([
1912
initIntl({
2013
fallbackLng: ['zh-CN', 'en-US'],
2114
}),
22-
initFlags(),
15+
pullFeatureFlags({
16+
timeout: 1000 * 4,
17+
fetchFeatureGating: () => Promise.resolve({} as unknown as FEATURE_FLAGS),
18+
}),
2319
dynamicImportMdBoxStyle(),
2420
]);
2521

0 commit comments

Comments
 (0)