name: Build PR Documentation

on:
  pull_request:
    paths:
      - 'docs/source/**'
      - 'assets/**'
      - '.github/workflows/doc-pr-build.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  build:
    uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
    with:
      commit_sha: ${{ github.event.pull_request.head.sha }}
      pr_number: ${{ github.event.number }}
      package: smolagents
      languages: en
      # additional_args: --not_python_module # use this arg if repository is documentation only