Conversation
This was referenced Feb 18, 2025
Comment on lines
14
to
51
| name: Check CLI docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Find Git ref | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| PR_NUMBER="${{ github.event.inputs.pr_number || null }}" | ||
| if test -n "${PR_NUMBER}"; then | ||
| GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" | ||
| else | ||
| GIT_REF="${{ github.ref }}" | ||
| fi | ||
| echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.GIT_REF }} | ||
| - uses: dsherret/rust-toolchain-file@v1 | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| global-json-file: modules/global.json | ||
| - name: Checkout docs | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: clockworklabs/spacetime-docs | ||
| ref: master | ||
| path: spacetime-docs | ||
| - name: Check for docs change | ||
| run: | | ||
| cargo run --features markdown-docs -p spacetimedb-cli > spacetime-docs/docs/cli-reference.md | ||
| cd spacetime-docs | ||
| if ! git diff-index --quiet HEAD; then | ||
| echo "It looks like the CLI docs have changed" | ||
| git diff | ||
| exit 1 | ||
| fi |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
bfops
commented
Feb 18, 2025
cloutiertyler
approved these changes
Feb 19, 2025
Contributor
cloutiertyler
left a comment
There was a problem hiding this comment.
Alright, given that this comes with a CI test to test the cfg, I'm willing to accept this.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Changes
This adds a new feature that makes
spacetimedb-clijust output markdown-formatted helptext. (It doesn't function as a normal CLI with this feature enabled, it just prints the helptext).This is in order to make it easy to generate CLI reference sections for our docs for clockworklabs/spacetime-docs#105.
API and ABI breaking changes
Not breaking.
Expected complexity level and risk
1
Testing
See clockworklabs/spacetime-docs#168 for an example of the output. That PR also includes README updates for how to use this change.
tl;dr
cargo run --features markdown-docs -p spacetimedb-cliCI