name: Generate Docs

on:
  push:
    branches:
      - main

jobs:
  cli:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-go@v5
        with:
          go-version: 'stable'

      - name: Generate CLI Docs
        run: ./scripts/gen-cli-docs

      - name: Create Pull Request
        id: cpr
        uses: peter-evans/create-pull-request@v7
        with:
          title: "docs(cli): update generated docs"
          commit-message: "docs(cli): update generated docs"
          body: ""
          branch: feat/gen-cli-docs

      - name: Check outputs
        run: |
          echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
          echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

