From 7b17c902ab1cd9cf3b4df947bce94c2360945155 Mon Sep 17 00:00:00 2001 From: Dan Halperin Date: Mon, 2 Feb 2026 17:46:33 -0800 Subject: [PATCH] ci: support external fork repositories in reusable workflow Add batfish_repository input to allow callers to specify which repository contains the batfish code to checkout. This enables lab validation for PRs from external contributors, whose branches exist in their forks rather than batfish/batfish. ---- Prompt: ``` Lab validation doesn't work for PRs from external contributors. Now it's failing on: https://github.com/batfish/batfish/actions/runs/21613339182/job/62286746884?pr=9757 /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/bgp-confederation-fix*:refs/remotes/origin/bgp-confederation-fix* +refs/tags/bgp-confederation-fix*:refs/tags/bgp-confederation-fix* The process '/usr/bin/git' failed with exit code 1 ``` commit-id:514bf778 --- .github/workflows/reusable-lab-validation.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-lab-validation.yml b/.github/workflows/reusable-lab-validation.yml index 00faf1f..7a44418 100644 --- a/.github/workflows/reusable-lab-validation.yml +++ b/.github/workflows/reusable-lab-validation.yml @@ -7,6 +7,11 @@ name: Lab Validation (reusable) on: workflow_call: inputs: + batfish_repository: + description: "GitHub repository for Batfish (e.g., batfish/batfish or user/batfish for forks)" + required: false + default: "batfish/batfish" + type: string batfish_ref: description: "Git ref for Batfish version to test" required: false @@ -68,7 +73,7 @@ jobs: - name: Checkout Batfish uses: actions/checkout@v4 with: - repository: batfish/batfish + repository: ${{ inputs.batfish_repository || 'batfish/batfish' }} path: batfish ref: ${{ inputs.batfish_ref || 'master' }}