Add json_properties_column_name #585
Workflow file for this run
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: Generate ReadMe Staging 🦉 | |
| on: | |
| # run this workflow on all PRs that have reference dirs changed | |
| pull_request: | |
| paths: | |
| - 'openapi/**' | |
| - 'reference/**' | |
| - '.github/actions/**' | |
| - '.github/workflows/rdme-staging.yml' | |
| jobs: | |
| # //////////////////////////////////////////////////////////////////////// | |
| # Pull Request | |
| # //////////////////////////////////////////////////////////////////////// | |
| # Create a new ReadMe version if it needs to and pushes content to the version | |
| rdme-staging: | |
| if: ${{ github.event.pull_request.head.repo.full_name == 'mixpanel/docs' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo 📚 | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - run: npm ci | |
| - name: Add node_modules to PATH | |
| run: echo "$PWD/node_modules/.bin" >> $GITHUB_PATH | |
| - name: Create readme version | |
| run: | | |
| status=$(curl -s -o /dev/null -w "%{http_code}" -X POST "https://api.readme.com/v2/branches" \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer ${{ secrets.README_API_KEY }}" \ | |
| -d '{ | |
| "name": "3.27-pr-${{ github.event.number }}", | |
| "base": "3.27", | |
| "release_stage": "release", | |
| "state": "current" | |
| }') | |
| if [ "$status" -eq 201 ]; then | |
| echo "Version created successfully" | |
| else | |
| echo "Errors because the version already exists, and so we can continue to the next step" | |
| fi | |
| - name: Push docs to version 🚀 | |
| uses: readmeio/rdme@5d702394cb1fd1dc3fab6e0769b44b56c9d425d1 # rdme version 10.6.0 | |
| with: | |
| rdme: reference upload ./reference --key=${{ secrets.README_API_KEY }} --branch=3.27-pr-${{ github.event.number }} | |
| - name: Build OpenAPI specs to version | |
| run: npm run api:build | |
| - name: Publish OpenAPI specs to version | |
| run: npm run api:publish | |
| env: | |
| README_API_KEY: ${{ secrets.README_API_KEY }} | |
| README_VERSION: 3.27-pr-${{ github.event.number }} | |
| # build and update comment with the proper link | |
| preview-notify: | |
| name: Preview / Notify | |
| runs-on: ubuntu-latest | |
| needs: | |
| - rdme-staging | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| .github | |
| reference | |
| # Build PR Comment | |
| - name: Build PR comment | |
| id: build-pr-comment | |
| uses: actions/github-script@v8 | |
| with: | |
| result-encoding: string | |
| script: | | |
| return ` | |
| # API Reference Preview | |
| :rocket: https://developer.mixpanel.com/v3.27-pr-${{ github.event.number }}/reference/overview | |
| Last updated: ${new Date().toLocaleString("en-US", {timeZone: "America/Los_Angeles"})} PT from ${{github.sha}} | |
| ` | |
| # Update PR Comment | |
| - uses: ./.github/actions/create-or-update-comment | |
| with: | |
| issue-number: ${{ github.event.number }} | |
| key: reference-pr-preview | |
| body: ${{ steps.build-pr-comment.outputs.result }} |