### Example Workflow: Run ubc check with ubc-action Source: https://github.com/useblocks/ubc-action/blob/main/README.md This example demonstrates how to use the ubc-action in a GitHub Actions workflow. It checks out the repository, sets up the ubc CLI using the action with provided license credentials, and then runs the 'ubc check .' command within the 'demo' directory. ```yaml name: Check demo project with ubc action on: [push, pull_request] permissions: id-token: write contents: read jobs: check: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5.0.0 with: submodules: "true" - name: Setup ubc uses: ./ with: license-key: ${{ secrets.UBC_LICENSE_KEY }} license-user: ${{ secrets.UBC_LICENSE_USER }} - name: Test action with default settings working-directory: ./demo run: ubc check . ``` -------------------------------- ### Install ubc CLI for Manual Use in Workflow Source: https://context7.com/useblocks/ubc-action/llms.txt Installs the ubc CLI tool without executing commands, making it available for subsequent steps in a GitHub Actions workflow. This is useful for running multiple ubc commands or integrating with other tools. Requires `ubuntu-latest` runner. ```yaml name: Setup and use ubc manually on: [push, pull_request] permissions: id-token: write contents: read jobs: validate: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5.0.0 with: submodules: "true" - name: Setup ubc uses: useblocks/ubc-action@v1 with: license-key: ${{ secrets.UBC_LICENSE_KEY }} license-user: ${{ secrets.UBC_LICENSE_USER }} - name: Verify installation run: ubc --version # Output: ubc 0.19.1 - name: Check documentation project working-directory: ./demo run: ubc check . ``` -------------------------------- ### Example ubproject.toml Configuration Source: https://context7.com/useblocks/ubc-action/llms.txt Defines project configuration for the ubc CLI using TOML format. This file specifies requirement types, linking options, custom scripts, and Sphinx/sphinx-needs integration settings for ubc validation. This is a configuration file, not executable code. ```toml # ubproject.toml - Example project configuration "$schema" = "https://ubcode.useblocks.com/ubproject.schema.json" [scripts] ``` -------------------------------- ### Setup Latest ubc Version in GitHub Actions Workflow Source: https://context7.com/useblocks/ubc-action/llms.txt Installs the most recent release of the ubc CLI in a GitHub Actions workflow by setting `version: 'latest'`. This ensures you are using the latest features, though pinning to a specific version is recommended for production stability. Requires `ubuntu-latest` runner. ```yaml name: Use latest ubc version on: [push] permissions: id-token: write contents: read jobs: check: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5.0.0 - name: Setup latest ubc uses: useblocks/ubc-action@v1 with: version: 'latest' license-key: ${{ secrets.UBC_LICENSE_KEY }} license-user: ${{ secrets.UBC_LICENSE_USER }} - name: Run validation run: ubc check ./docs ``` -------------------------------- ### Execute ubc Command Directly via Args in Workflow Source: https://context7.com/useblocks/ubc-action/llms.txt Sets up and immediately executes a ubc command using the `args` input parameter within a GitHub Actions workflow. This streamlines the process by combining installation and execution into a single step. Requires `ubuntu-latest` runner. ```yaml name: Check demo project with ubc action and args on: [push, pull_request] permissions: id-token: write contents: read jobs: check-with-args: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5.0.0 with: submodules: "true" - name: Setup and run ubc check uses: useblocks/ubc-action@v1 with: args: check . # Executes: ubc check . working-directory: ./demo # Run in demo directory license-key: ${{ secrets.UBC_LICENSE_KEY }} license-user: ${{ secrets.UBC_LICENSE_USER }} ``` -------------------------------- ### Setup ubc CLI in GitHub Actions Workflow Source: https://context7.com/useblocks/ubc-action/llms.txt Configures the ubc CLI within a GitHub Actions workflow. It allows specifying the version, license details, working directory, and optional arguments for immediate command execution. Requires `ubuntu-latest` runner. ```yaml # .github/workflows/ubc-check.yml name: UBC Documentation Check on: [push, pull_request] permissions: id-token: write contents: read jobs: check: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v5.0.0 - name: Setup ubc CLI uses: useblocks/ubc-action@v1 with: version: '0.19.1' # Optional: specific version or 'latest' license-key: ${{ secrets.UBC_LICENSE_KEY }} # Required for private projects license-user: ${{ secrets.UBC_LICENSE_USER }} # Required for private projects working-directory: ./docs # Optional: defaults to repository root args: '' # Optional: if provided, executes ubc immediately ``` -------------------------------- ### Sphinx Configuration for sphinx-needs Source: https://context7.com/useblocks/ubc-action/llms.txt Shows how to configure Sphinx's `conf.py` to integrate with `sphinx-needs`. It enables the `sphinx_needs` extension and specifies that needs configurations should be loaded from `ubproject.toml`. ```python # conf.py - Sphinx configuration for sphinx-needs integration extensions = ["sphinx_needs"] # Load needs configuration from ubproject.toml needs_from_toml = "ubproject.toml" ``` -------------------------------- ### Custom Build Scripts with uv Source: https://context7.com/useblocks/ubc-action/llms.txt Defines custom build scripts using `uv` for Sphinx documentation. It includes commands for running Sphinx with specific packages and cleaning the build directory. The `sphinx:clean` chain combines these operations. ```toml sphinx = "uv run --no-project --with 'sphinx,sphinx-needs~=4.2' sphinx-build -W -b html . _build" rm_build = "rm -rf _build" "sphinx:clean" = { chain = ["rm_build", "sphinx"] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.