|
50 | 50 |
|
51 | 51 | - name: Publish to npm |
52 | 52 | run: pnpm publish --no-git-checks |
| 53 | + |
| 54 | + sync-docs: |
| 55 | + needs: release |
| 56 | + if: ${{ needs.release.outputs.release_created == 'true' }} |
| 57 | + runs-on: ubuntu-slim |
| 58 | + permissions: |
| 59 | + contents: read |
| 60 | + steps: |
| 61 | + - name: Checkout rl-cli |
| 62 | + uses: actions/checkout@v6 |
| 63 | + with: |
| 64 | + path: rl-cli |
| 65 | + |
| 66 | + - name: Setup pnpm |
| 67 | + uses: pnpm/action-setup@v5 |
| 68 | + |
| 69 | + - name: Setup Node.js |
| 70 | + uses: actions/setup-node@v6 |
| 71 | + with: |
| 72 | + node-version: "24" |
| 73 | + cache: "pnpm" |
| 74 | + cache-dependency-path: rl-cli/pnpm-lock.yaml |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: pnpm install --frozen-lockfile |
| 78 | + working-directory: rl-cli |
| 79 | + |
| 80 | + - name: Build |
| 81 | + run: pnpm run build |
| 82 | + working-directory: rl-cli |
| 83 | + |
| 84 | + - name: Generate CLI docs |
| 85 | + run: node scripts/generate-command-docs.js --skip-readme --docs-path "$GITHUB_WORKSPACE/rl-cli.mdx" |
| 86 | + working-directory: rl-cli |
| 87 | + |
| 88 | + - name: Create GitHub App token |
| 89 | + id: app-token |
| 90 | + uses: actions/create-github-app-token@v2 |
| 91 | + with: |
| 92 | + app-id: ${{ vars.DEPLOY_APP_CLIENT_ID }} |
| 93 | + private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} |
| 94 | + repositories: docs |
| 95 | + permission-contents: write |
| 96 | + permission-pull-requests: write |
| 97 | + |
| 98 | + - name: Get GitHub App User ID |
| 99 | + id: get-user-id |
| 100 | + env: |
| 101 | + GH_TOKEN: ${{ steps.app-token.outputs.token }} |
| 102 | + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" |
| 103 | + |
| 104 | + - name: Checkout docs repo |
| 105 | + uses: actions/checkout@v6 |
| 106 | + with: |
| 107 | + repository: runloopai/docs |
| 108 | + token: ${{ steps.app-token.outputs.token }} |
| 109 | + path: docs |
| 110 | + |
| 111 | + - name: Copy generated docs |
| 112 | + run: cp "$GITHUB_WORKSPACE/rl-cli.mdx" docs/docs/tools/rl-cli.mdx |
| 113 | + |
| 114 | + - name: Create Pull Request |
| 115 | + uses: runloopai/create-pull-request@main |
| 116 | + with: |
| 117 | + token: ${{ steps.app-token.outputs.token }} |
| 118 | + path: docs |
| 119 | + commit-message: "docs: update rl-cli command reference for ${{ needs.release.outputs.tag_name }}" |
| 120 | + committer: "${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" |
| 121 | + author: "${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" |
| 122 | + title: "docs: update rl-cli command reference for ${{ needs.release.outputs.tag_name }}" |
| 123 | + body: | |
| 124 | + Auto-generated from [rl-cli ${{ needs.release.outputs.tag_name }}](https://github.com/runloopai/rl-cli/releases/tag/${{ needs.release.outputs.tag_name }}). |
| 125 | +
|
| 126 | + Updates the CLI command reference documentation to match the latest release. |
| 127 | + branch: rl-cli-docs/${{ needs.release.outputs.tag_name }} |
| 128 | + delete-branch: true |
0 commit comments