From f9cb5e659c8dab284e6373280a4e1d989d4be5ad Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Mon, 8 Dec 2025 12:44:36 +0100 Subject: [PATCH] chore(ci): skip workflows if not lerobot repository (#2601) Co-authored-by: Alex Tyshka --- .github/workflows/documentation-upload-pr.yml | 3 ++- .github/workflows/documentation.yml | 6 ++++-- .github/workflows/fast_tests.yml | 1 - .github/workflows/nightly.yml | 2 ++ .github/workflows/release.yml | 1 + .github/workflows/stale.yml | 1 + .github/workflows/unbound_deps_tests.yml | 1 + 7 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation-upload-pr.yml b/.github/workflows/documentation-upload-pr.yml index 22ba11cbb..6ee2a5caa 100644 --- a/.github/workflows/documentation-upload-pr.yml +++ b/.github/workflows/documentation-upload-pr.yml @@ -31,7 +31,8 @@ jobs: name: Upload Preview and Comment if: > github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + github.event.workflow_run.conclusion == 'success' && + github.repository == 'huggingface/lerobot' uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main with: package_name: lerobot diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 96005af3f..3007578fc 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -42,7 +42,9 @@ jobs: # This job builds and deploys the official documentation. build_main_docs: name: Build Main Docs - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + if: > + (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && + github.repository == 'huggingface/lerobot' permissions: contents: read uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main @@ -58,7 +60,7 @@ jobs: # The result of this job triggers the 'Upload PR Documentation' workflow. build_pr_docs: name: Build PR Docs - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && github.repository == 'huggingface/lerobot' permissions: contents: read pull-requests: write diff --git a/.github/workflows/fast_tests.yml b/.github/workflows/fast_tests.yml index a39773b4e..ffd3195c2 100644 --- a/.github/workflows/fast_tests.yml +++ b/.github/workflows/fast_tests.yml @@ -45,7 +45,6 @@ permissions: env: UV_VERSION: "0.8.0" PYTHON_VERSION: "3.10" - DOCKER_IMAGE_NAME: huggingface/lerobot-gpu # Ensures that only the latest commit for a PR or branch is built, canceling older runs. concurrency: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index be8b5c094..94d5cc9f2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -43,6 +43,7 @@ jobs: name: Build CPU Docker for Nightly runs-on: group: aws-general-8-plus + if: github.repository == 'huggingface/lerobot' outputs: image_tag: ${{ env.DOCKER_IMAGE_NAME_CPU }} steps: @@ -77,6 +78,7 @@ jobs: name: Build GPU Docker for Nightly runs-on: group: aws-general-8-plus + if: github.repository == 'huggingface/lerobot' outputs: image_tag: ${{ env.DOCKER_IMAGE_NAME_GPU }} steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4891707ac..7b159dd17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: build-and-publish: name: Build and publish Python distributions runs-on: ubuntu-latest + if: github.repository == 'huggingface/lerobot' outputs: version: ${{ steps.extract_info.outputs.tag_version }} permissions: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 06fc69fc4..4dc119b5e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -45,6 +45,7 @@ jobs: stale: name: Close Stale Issues and PRs runs-on: ubuntu-latest + if: github.repository == 'huggingface/lerobot' permissions: actions: write contents: write # only for delete-branch option diff --git a/.github/workflows/unbound_deps_tests.yml b/.github/workflows/unbound_deps_tests.yml index 92271ba8e..b3be9ccdf 100644 --- a/.github/workflows/unbound_deps_tests.yml +++ b/.github/workflows/unbound_deps_tests.yml @@ -43,6 +43,7 @@ jobs: full-tests: name: Full Unbound Tests runs-on: ubuntu-latest + if: github.repository == 'huggingface/lerobot' env: MUJOCO_GL: egl HF_HOME: /mnt/cache/.cache/huggingface