Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate rest api docs generation #4168

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/sync-rest-api-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Sync Camunda REST API

on:
schedule:
- cron: "0 15 * * 4" # Runs every Thursday at 3 PM UTC
nicpuppa marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
sync-file:
runs-on: ubuntu-latest

steps:
- name: Checkout Camunda docs repository
uses: actions/checkout@v3
with:
repository: camunda/camunda-docs
path: docs

- name: Checkout Camunda repository
uses: actions/checkout@v3
with:
repository: camunda/camunda
path: rest-spec
sparse-checkout: zeebe/gateway-protocol/src/main/proto/rest-api.yaml
nicpuppa marked this conversation as resolved.
Show resolved Hide resolved
sparse-checkout-cone-mode: false

- name: Sync documentation
run: |
cd docs
mv ../rest-spec/zeebe/gateway-protocol/src/main/proto/rest-api.yaml api/camunda/camunda-openapi.yaml
npm i
npm run api:generate:camunda
if git diff-index --quiet HEAD; then
echo "No changes to commit."
exit 0
fi

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: "${{ secrets.GITHUB_TOKEN }}"
path: docs
title: Update camunda REST API doc
body: |
## Description

This is an autogenerated PR by the [sync api specs workflow](https://github.com/camunda/camunda-docs/tree/main/.github/workflows/sync-rest-api-docs.yaml).
This PR contains every changes made to the REST api specs in the [monorepo](https://github.com/camunda/camunda/blob/main/zeebe/gateway-protocol/src/main/proto/rest-api.yaml) in the last week.
This PR contains also all the generated OpenAPI files related to the changes.

## When should this change go live?

- There is **no urgency** with this change and can be released at any time.

## PR Checklist

- My changes are for the **next minor** and are in `/docs` directory (aka `/next/`).
- My changes require a [technical writer review](https://github.com/camunda/camunda-docs/blob/main/howtos/documentation-guidelines.md#review-process), and I've assigned @camunda/tech-writers as a reviewer.

commit-message: "docs: update REST API spec"
branch: update-rest-doc
delete-branch: true
reviewers: camunda/tech-writers,pepopowitz
base: main
nicpuppa marked this conversation as resolved.
Show resolved Hide resolved
labels: deploy
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

npx lint-staged
Loading