Repository navigation
docs: generate the Markdown reference on release and remove HogRef generation #1185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+86
−545
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
151bef5
docs: generate the Markdown reference on release and remove HogRef ge…
gewenyu99 3d593c7
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 82c1b58
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 74a95d3
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 e47035e
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 f596802
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 f4c2118
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 a4b59ec
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 146c8e1
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 c05acb5
ci: add a workflow that regenerates the reference by hand
gewenyu99 27a0933
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 230a8ce
ci: install the dev extra in the manual reference run, and don't let …
gewenyu99 7f5218d
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 0c0cc51
ci: warn when the SDK reference doesn't regenerate
gewenyu99 ee45c4d
Merge markdown-reference-8 into markdown-reference-release
gewenyu99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Generate references | ||
|
|
||
| # Regenerates references/ by hand, for when the release's best-effort reference step fails | ||
| # or the pages need a refresh. Same shape as posthog-js's generate-references.yml. | ||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| generate-references: | ||
| name: Generate SDK reference | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Get GitHub App token | ||
| id: releaser | ||
| uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 | ||
| with: | ||
| client-id: ${{ secrets.GH_APP_POSTHOG_PYTHON_RELEASER_APP_ID }} | ||
| private-key: ${{ secrets.GH_APP_POSTHOG_PYTHON_RELEASER_PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: main | ||
| token: ${{ steps.releaser.outputs.token }} | ||
|
|
||
| - name: Check out sdk-specs | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: PostHog/sdk-specs | ||
| path: .sdk-specs | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: 3.11 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 | ||
| with: | ||
| version: "0.13.4" | ||
| enable-cache: true | ||
|
|
||
| - name: Generate references | ||
| id: changes | ||
| run: | | ||
| uv run --extra dev bin/docs --sdk-specs .sdk-specs | ||
| git add references | ||
| git diff --cached --quiet || echo "changed=true" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Commit generated references | ||
| if: steps.changes.outputs.changed == 'true' | ||
| uses: planetscale/ghcommit-action@a6b150b81dca5dd027baa898604418eec9e11465 # v0.2.22 | ||
| with: | ||
| commit_message: "docs: update the SDK reference [skip ci]" | ||
| repo: ${{ github.repository }} | ||
| branch: main | ||
| file_pattern: references/ | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.releaser.outputs.token }} |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| #!/usr/bin/env bash | ||
| #/ Usage: bin/docs | ||
| #/ Description: Generate documentation for the PostHog Python SDK | ||
| #/ Usage: bin/docs --sdk-specs <PostHog/sdk-specs checkout> | ||
| #/ Description: Generate the Markdown reference for the PostHog Python SDK | ||
| source bin/helpers/_utils.sh | ||
| set_source_and_root_dir | ||
| ensure_virtual_env | ||
|
|
||
| exec python3 "$(dirname "$0")/docs_scripts/generate_json_schemas.py" "$@" | ||
| exec python3 "$(dirname "$0")/docs_scripts/generate_markdown.py" "$@" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.