chore: Fix python v2 lang/label selectors (#171) #43
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
| name: Sync OpenAPI to docs repo | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "openapi.yaml" | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout openapi-spec | |
| uses: actions/checkout@v4 | |
| - name: Set up SSH for deploy key | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.DOCS_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| - name: Clone docs repo | |
| run: | | |
| git clone [email protected]:togethercomputer/mintlify-docs.git | |
| cp openapi.yaml mintlify-docs/openapi.yaml | |
| - name: Commit and push update | |
| env: | |
| GH_TOKEN: ${{ secrets.DOCS_REPO_PAT }} | |
| run: | | |
| cd mintlify-docs | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --quiet openapi.yaml; then | |
| echo "No changes to commit" | |
| exit 0 | |
| fi | |
| BRANCH_NAME=sync-openapi-$(date +%s) | |
| 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 |