ci: properly update proto reference in docs
@@ -276,10 +276,22 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ORY_BOT_PAT }}
run: |
- cp "current-repo/docs/.generated/proto-api.mdx" "docs/docs/keto/reference/proto-api.mdx"
+ head_separator="<!-- AUTOGENERATED - DO NOT EDIT! -->"
+ echo "---
+ title: Protocol buffers API
+ ---
+
+ <!-- This file is generated. Please edit the .proto files instead to update the documentation -->" > "docs/docs/keto/reference/proto-api.mdx"
+ cat "current-repo/proto/buf.md" >> "docs/docs/keto/reference/proto-api.mdx"
cd docs
- git stash || true
- git pull --rebase origin master || true
- git stash apply || true
- git push origin HEAD:master || true
+ if git diff --exit-code; then
+ echo "No changes to commit"
+ exit 0
+ fi
+ git stash
+ git pull --rebase origin master
+ git stash apply
+ git add docs/keto/reference/proto-api.mdx
+ git commit -m "autogen: update Keto protobuf docs"
+ git push origin HEAD:master
shell: bash
