chore: org renamed (#141) #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sync docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- README.md | |
jobs: | |
sync-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 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: Set up Git | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
- name: Clone heroui repository | |
run: | | |
git clone https://github.com/heroui-inc/heroui-cli heroui --depth 1 | |
- name: Run docs sync script | |
run: | | |
pnpm sync:docs | |
- name: Get version from package.json | |
id: get_version | |
run: | | |
VERSION=$(jq -r '.version' package.json) | |
echo "::set-output name=version::$VERSION" | |
- name: Commit changes to heroui repository | |
run: | | |
cd heroui | |
git add . | |
git commit -m "docs: sync api from heroui-cli v${{ steps.get_version.outputs.version }}" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
path: heroui | |
branch: sync-docs-${{ steps.get_version.outputs.version }}-${{ github.run_id }} | |
title: "docs: sync api from heroui-cli v${{ steps.get_version.outputs.version }}" | |
body: Sync api from heroui-cli. |