mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-07 23:33:14 +08:00
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 4
to 5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pnpm/action-setup/releases">pnpm/action-setup's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<p>Updated the action to use Node.js 24.</p>
<h2>v4.4.0</h2>
<p>Updated the action to use Node.js 24.</p>
<h2>v4.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>docs: fix the run_install example in the Readme by <a
href="https://github.com/dreyks"><code>@dreyks</code></a> in <a
href="https://redirect.github.com/pnpm/action-setup/pull/175">pnpm/action-setup#175</a></li>
<li>chore: remove unused <code>@types/node-fetch</code> dependency by <a
href="https://github.com/silverwind"><code>@silverwind</code></a> in <a
href="https://redirect.github.com/pnpm/action-setup/pull/186">pnpm/action-setup#186</a></li>
<li>Clarify that package_json_file is relative to GITHUB_WORKSPACE by <a
href="https://github.com/chris-martin"><code>@chris-martin</code></a>
in <a
href="https://redirect.github.com/pnpm/action-setup/pull/184">pnpm/action-setup#184</a></li>
<li>feat: store caching by <a
href="https://github.com/jrmajor"><code>@jrmajor</code></a> in <a
href="https://redirect.github.com/pnpm/action-setup/pull/188">pnpm/action-setup#188</a></li>
<li>refactor: remove star imports by <a
href="https://github.com/KSXGitHub"><code>@KSXGitHub</code></a> in <a
href="https://redirect.github.com/pnpm/action-setup/pull/196">pnpm/action-setup#196</a></li>
<li>fix(ci): exclude macos by <a
href="https://github.com/KSXGitHub"><code>@KSXGitHub</code></a> in <a
href="https://redirect.github.com/pnpm/action-setup/pull/197">pnpm/action-setup#197</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/dreyks"><code>@dreyks</code></a> made
their first contribution in <a
href="https://redirect.github.com/pnpm/action-setup/pull/175">pnpm/action-setup#175</a></li>
<li><a
href="https://github.com/silverwind"><code>@silverwind</code></a> made
their first contribution in <a
href="https://redirect.github.com/pnpm/action-setup/pull/186">pnpm/action-setup#186</a></li>
<li><a
href="https://github.com/chris-martin"><code>@chris-martin</code></a>
made their first contribution in <a
href="https://redirect.github.com/pnpm/action-setup/pull/184">pnpm/action-setup#184</a></li>
<li><a href="https://github.com/jrmajor"><code>@jrmajor</code></a> made
their first contribution in <a
href="https://redirect.github.com/pnpm/action-setup/pull/188">pnpm/action-setup#188</a></li>
<li><a
href="https://github.com/Boosted-Bonobo"><code>@Boosted-Bonobo</code></a>
made their first contribution in <a
href="https://redirect.github.com/pnpm/action-setup/pull/199">pnpm/action-setup#199</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pnpm/action-setup/compare/v4.2.0...v4.3.0">https://github.com/pnpm/action-setup/compare/v4.2.0...v4.3.0</a></p>
<h2>v4.2.0</h2>
<p>When there's a <code>.npmrc</code> file at the root of the
repository, pnpm will be fetched from the registry that is specified in
that <code>.npmrc</code> file <a
href="https://redirect.github.com/pnpm/action-setup/pull/179">#179</a></p>
<h2>v4.1.0</h2>
<p>Add support for <code>package.yaml</code> <a
href="https://redirect.github.com/pnpm/action-setup/pull/156">#156</a>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fc06bc1257"><code>fc06bc1</code></a>
feat!: run the action on Node.js 24 (<a
href="https://redirect.github.com/pnpm/action-setup/issues/205">#205</a>)</li>
<li>See full diff in <a
href="https://github.com/pnpm/action-setup/compare/v4...v5">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
232 lines
8.4 KiB
YAML
232 lines
8.4 KiB
YAML
name: GitHub Issue Tracker with Feishu Notification
|
||
|
||
on:
|
||
issues:
|
||
types: [opened]
|
||
schedule:
|
||
# Run every day at 8:30 Beijing Time (00:30 UTC)
|
||
- cron: "30 0 * * *"
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
process-new-issue:
|
||
if: github.repository == 'CherryHQ/cherry-studio' && github.event_name == 'issues'
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
issues: write
|
||
contents: read
|
||
id-token: write
|
||
|
||
steps:
|
||
- name: Checkout repository
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Check Beijing Time
|
||
id: check_time
|
||
run: |
|
||
# Get current time in Beijing timezone (UTC+8)
|
||
BEIJING_HOUR=$(TZ='Asia/Shanghai' date +%H)
|
||
BEIJING_MINUTE=$(TZ='Asia/Shanghai' date +%M)
|
||
|
||
echo "Beijing Time: ${BEIJING_HOUR}:${BEIJING_MINUTE}"
|
||
|
||
# Check if time is between 00:00 and 08:30
|
||
if [ $BEIJING_HOUR -lt 8 ] || ([ $BEIJING_HOUR -eq 8 ] && [ $BEIJING_MINUTE -le 30 ]); then
|
||
echo "should_delay=true" >> $GITHUB_OUTPUT
|
||
echo "⏰ Issue created during quiet hours (00:00-08:30 Beijing Time)"
|
||
echo "Will schedule notification for 08:30"
|
||
else
|
||
echo "should_delay=false" >> $GITHUB_OUTPUT
|
||
echo "✅ Issue created during active hours, will notify immediately"
|
||
fi
|
||
|
||
- name: Add pending label if in quiet hours
|
||
if: steps.check_time.outputs.should_delay == 'true'
|
||
uses: actions/github-script@v8
|
||
with:
|
||
script: |
|
||
github.rest.issues.addLabels({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
issue_number: context.issue.number,
|
||
labels: ['pending-feishu-notification']
|
||
});
|
||
|
||
- name: Setup Node.js
|
||
if: steps.check_time.outputs.should_delay == 'false'
|
||
uses: actions/setup-node@v6
|
||
with:
|
||
node-version-file: '.node-version'
|
||
|
||
- name: Install pnpm
|
||
uses: pnpm/action-setup@v5
|
||
|
||
- name: Get pnpm store directory
|
||
id: pnpm-cache
|
||
shell: bash
|
||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||
|
||
- name: Cache pnpm dependencies
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-pnpm-
|
||
|
||
- name: Install dependencies
|
||
if: steps.check_time.outputs.should_delay == 'false'
|
||
run: pnpm install
|
||
|
||
- name: Process issue with Claude
|
||
if: steps.check_time.outputs.should_delay == 'false'
|
||
uses: anthropics/claude-code-action@v1
|
||
with:
|
||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||
allowed_non_write_users: "*"
|
||
anthropic_api_key: ${{ secrets.CLAUDE_TRANSLATOR_APIKEY }}
|
||
claude_args: "--allowed-tools Bash(gh issue:*),Bash(pnpm tsx scripts/feishu-notify.ts*)"
|
||
prompt: |
|
||
你是一个GitHub Issue自动化处理助手。请完成以下任务:
|
||
|
||
## 当前Issue信息
|
||
- Issue编号:#${{ github.event.issue.number }}
|
||
- 标题:${{ github.event.issue.title }}
|
||
- 作者:${{ github.event.issue.user.login }}
|
||
- URL:${{ github.event.issue.html_url }}
|
||
- 标签:${{ join(github.event.issue.labels.*.name, ', ') }}
|
||
|
||
### Issue body
|
||
|
||
`````md
|
||
${{ github.event.issue.body }}
|
||
`````
|
||
|
||
## 任务步骤
|
||
|
||
1. **分析并总结issue**
|
||
用中文(简体)提供简洁的总结(2-3句话),包括:
|
||
- 问题的主要内容
|
||
- 核心诉求
|
||
- 重要的技术细节
|
||
|
||
2. **发送飞书通知**
|
||
使用CLI工具发送飞书通知,参考以下示例:
|
||
```bash
|
||
pnpm tsx scripts/feishu-notify.ts issue \
|
||
-u "${{ github.event.issue.html_url }}" \
|
||
-n "${{ github.event.issue.number }}" \
|
||
-t "${{ github.event.issue.title }}" \
|
||
-a "${{ github.event.issue.user.login }}" \
|
||
-l "${{ join(github.event.issue.labels.*.name, ',') }}" \
|
||
-m "<你生成的中文总结>"
|
||
```
|
||
|
||
## 注意事项
|
||
- 总结必须使用简体中文
|
||
- 命令行参数需要正确转义特殊字符
|
||
- 如果issue内容为空,也要提供一个简短的说明
|
||
|
||
请开始执行任务!
|
||
env:
|
||
ANTHROPIC_BASE_URL: ${{ secrets.CLAUDE_TRANSLATOR_BASEURL }}
|
||
FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }}
|
||
FEISHU_WEBHOOK_SECRET: ${{ secrets.FEISHU_WEBHOOK_SECRET }}
|
||
|
||
process-pending-issues:
|
||
if: github.repository == 'CherryHQ/cherry-studio' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
issues: write
|
||
contents: read
|
||
id-token: write
|
||
|
||
steps:
|
||
- name: Checkout repository
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Setup Node.js
|
||
uses: actions/setup-node@v6
|
||
with:
|
||
node-version-file: '.node-version'
|
||
|
||
- name: Install pnpm
|
||
uses: pnpm/action-setup@v5
|
||
|
||
- name: Get pnpm store directory
|
||
id: pnpm-cache
|
||
shell: bash
|
||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||
|
||
- name: Cache pnpm dependencies
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-pnpm-
|
||
|
||
- name: Install dependencies
|
||
run: pnpm install
|
||
|
||
- name: Process pending issues with Claude
|
||
uses: anthropics/claude-code-action@v1
|
||
with:
|
||
anthropic_api_key: ${{ secrets.CLAUDE_TRANSLATOR_APIKEY }}
|
||
allowed_non_write_users: "*"
|
||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||
claude_args: "--allowed-tools Bash(gh issue:*),Bash(gh api:*),Bash(pnpm tsx scripts/feishu-notify.ts*)"
|
||
prompt: |
|
||
你是一个GitHub Issue自动化处理助手。请完成以下任务:
|
||
|
||
## 任务说明
|
||
处理所有待发送飞书通知的GitHub Issues(标记为 `pending-feishu-notification` 的issues)
|
||
|
||
## 步骤
|
||
|
||
1. **获取待处理的issues**
|
||
使用以下命令获取所有带 `pending-feishu-notification` 标签的issues:
|
||
```bash
|
||
gh api repos/${{ github.repository }}/issues?labels=pending-feishu-notification&state=open
|
||
```
|
||
|
||
2. **总结每个issue**
|
||
对于每个找到的issue,用中文提供简洁的总结(2-3句话),包括:
|
||
- 问题的主要内容
|
||
- 核心诉求
|
||
- 重要的技术细节
|
||
|
||
3. **发送飞书通知**
|
||
使用CLI工具发送飞书通知,参考以下示例:
|
||
```bash
|
||
pnpm tsx scripts/feishu-notify.ts issue \
|
||
-u "<issue的html_url>" \
|
||
-n "<issue编号>" \
|
||
-t "<issue标题>" \
|
||
-a "<issue作者>" \
|
||
-l "<逗号分隔的标签列表,排除pending-feishu-notification>" \
|
||
-m "<你生成的中文总结>"
|
||
```
|
||
|
||
4. **移除标签**
|
||
成功发送后,使用以下命令移除 `pending-feishu-notification` 标签:
|
||
```bash
|
||
gh api -X DELETE repos/${{ github.repository }}/issues/<issue编号>/labels/pending-feishu-notification
|
||
```
|
||
|
||
## 环境变量
|
||
- Repository: ${{ github.repository }}
|
||
- Feishu webhook URL和密钥已在环境变量中配置好
|
||
|
||
## 注意事项
|
||
- 如果没有待处理的issues,输出提示信息后直接结束
|
||
- 处理多个issues时,每个issue之间等待2-3秒,避免API限流
|
||
- 如果某个issue处理失败,继续处理下一个,不要中断整个流程
|
||
- 所有总结必须使用中文(简体中文)
|
||
|
||
请开始执行任务!
|
||
env:
|
||
ANTHROPIC_BASE_URL: ${{ secrets.CLAUDE_TRANSLATOR_BASEURL }}
|
||
FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }}
|
||
FEISHU_WEBHOOK_SECRET: ${{ secrets.FEISHU_WEBHOOK_SECRET }}
|