Skip to content
Merged
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
24 changes: 15 additions & 9 deletions .github/workflows/sync-openapi-spec-to-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,22 @@ jobs:
exit 0
fi

BRANCH_NAME=sync-openapi-$(date +%s)
BRANCH_NAME=sync-openapi

git checkout -b "$BRANCH_NAME"
git add openapi.yaml
git commit -m "Sync OpenAPI spec"
git push origin "$BRANCH_NAME"

gh pr create \
--title "Sync OpenAPI spec" \
--body "This PR syncs the openapi.yaml from the togethercomputer/openapi repository." \
--base main \
--head "$BRANCH_NAME" \
--assignee ryanto,zainhas,Nutlope
git push --force origin "$BRANCH_NAME"

EXISTING_PR=$(gh pr list --state open --head "$BRANCH_NAME" --json number --jq '.[0].number')

if [ -n "$EXISTING_PR" ]; then
echo "Updated existing PR #$EXISTING_PR"
else
gh pr create \
--title "Sync OpenAPI spec" \
--body "This PR syncs the openapi.yaml from the togethercomputer/openapi repository." \
--base main \
--head "$BRANCH_NAME" \
--assignee ryanto,zainhas,Nutlope,muhsinking
fi
Loading