Skip to content

Commit

Permalink
feat(rest-api-automation): add workflow to update camunda rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpuppa committed Aug 17, 2024
1 parent fadd568 commit 0e0f8cc
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/sync-rest-api-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Sync Camunda REST API

on:
pull_request:
branches:
- main
schedule:
- cron: "0 16 * * 4" # Runs every Thursday at 4 PM UTC
workflow_dispatch:

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

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

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

- name: Create branch
run: |
git checkout -b camunda-rest-api-documentation-update
- name: Copy file
run: |
cp camunda-repo/zeebe/gateway-protocol/src/main/proto/rest-api.yaml api/camunda/camunda-openapi.yaml
- name: Run custom command
run: |
ls
npm run api:generate:camunda
- name: Check for changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit."
exit 0
fi
git commit -m "docs(camunda-api): updates camunda rest api documentation"
- name: Push changes and create PR
run: |
git push --set-upstream origin camunda-rest-api-documentation-update
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Update camunda REST API"
body: "This PR updates the camunda REST API"
branch: "camunda-rest-api-documentation-update"
base: "main"

0 comments on commit 0e0f8cc

Please sign in to comment.