chore(actions): improved auto code gen commit messages #8
This file contains hidden or 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
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
| name: Upload the Isaacus API OpenAPI specification to Stainless and Mintlify | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "openapi.yaml" | |
| - ".github/workflows/upload-to-stainless-and-mintlify.yaml" | |
| - "config/stainless.yaml" | |
| jobs: | |
| stainless: | |
| concurrency: upload-openapi-spec-action | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Push the OpenAPI specification to Stainless and output the autodocumented specification | |
| uses: stainless-api/upload-openapi-spec-action@main | |
| with: | |
| stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} | |
| input_path: "openapi.yaml" | |
| config_path: "config/stainless.yaml" | |
| output_path: "openapi.autodocumented.json" | |
| project_name: "isaacus" | |
| commit_message: "feat(api): added latest OpenAPI specification" | |
| - name: JSON to YAML | |
| run: | | |
| pip install pyyaml && \ | |
| python -c "import sys, json, yaml; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)" < openapi.autodocumented.json > openapi.yaml | |
| - name: Push autodocumented OpenAPI specification to Mintlify | |
| uses: dmnemec/copy_file_to_another_repo_action@main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_FOR_DOCS_GITHUB_REPO }} | |
| with: | |
| source_file: "openapi.yaml" | |
| destination_repo: "isaacus-dev/docs" | |
| destination_folder: "api" | |
| user_email: "[email protected]" | |
| user_name: "umarbutler" | |
| commit_message: "docs(api): added latest autodocumented OpenAPI specification" |