Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe committed May 23, 2024
1 parent a18f73e commit ce1c1cc
Showing 1 changed file with 49 additions and 36 deletions.
85 changes: 49 additions & 36 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
name: Sync README to nextui-org/nextui
name: Update B Repository # 工作流程的名称

on:
push:
paths:
- 'README.md'
branches:
- docs-sync # test for now

jobs:
sync-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
check-latest: true
node-version-file: '.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Clone target repository
run: |
git clone https://github.com/winchesHe/nextui
- name: Run Sync docs
run: |
pnpm "sync:docs"
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cd nextui
git config --global user.name "winchesHe"
git config --global user.email "[email protected]"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: sync README.md from nextui-cli"
branch: main
title: "docs: sync README.md from nextui-cli"
body: This PR was automatically created by GitHub Actions to sync README.md.
update-b-repo: # 工作流程中的一个任务
runs-on: ubuntu-latest # 任务运行的环境

steps: # 任务中的步骤
- name: Checkout A repository # 第一步:检出 A 仓库的代码
uses: actions/checkout@v3

- name: Set up Git # 第二步:设置 Git 用户信息
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Clone B repository # 第三步:克隆 B 仓库并创建一个新分支
run: |
git clone https://github.com/winchesHe/nextui B-repo --depth 1 # 替换为实际的 B 仓库路径
cd B-repo
git checkout -b update-branch # 创建一个新分支
- name: Make changes to B repository # 第四步:在 B 仓库中进行修改并提交更改
run: |
cd B-repo
# 在这里添加你的命令来修改 B 仓库
echo "Some changes" > some-file.txt
git add .
git commit -m "Update from A repository"
- name: Push changes to B repository # 第五步:将更改推送到 B 仓库的新分支
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd B-repo
git push origin update-branch
- name: Create Pull Request # 第六步:创建一个 Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: https://github.com/winchesHe/nextui/B-repo # 替换为实际的 B 仓库路径
head: update-branch
base: main
path: B-repo
branch: update-branch
push-to-fork: winchesHe/B-repo
title: "Update from A repository"
body: "This PR updates B repository with changes from A repository."

0 comments on commit ce1c1cc

Please sign in to comment.