From 3d7b79a696ed260b00230eb4eacfdd9508b186c2 Mon Sep 17 00:00:00 2001 From: rryoung98 Date: Thu, 2 Jul 2026 23:20:20 -0500 Subject: [PATCH 1/2] Skip qBraid API notebooks in CI when no API key is available (fork PRs) Repo secrets are not exposed to pull_request workflow runs triggered from forks, so QBRAID_API_KEY is empty and every notebook that instantiates QbraidProvider fails with a 401. Skip those notebooks when the key is absent; internal PRs still execute them fully. Co-Authored-By: Claude Fable 5 --- .github/workflows/execute-notebooks.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/execute-notebooks.yml b/.github/workflows/execute-notebooks.yml index d3f6905..d49b59b 100644 --- a/.github/workflows/execute-notebooks.yml +++ b/.github/workflows/execute-notebooks.yml @@ -70,6 +70,14 @@ jobs: continue fi + # Skip notebooks that authenticate with the qBraid API when no key is + # available (secrets are not exposed to pull_request runs from forks) + if [ -z "$QBRAID_API_KEY" ] && grep -qE "QbraidProvider|QbraidClient" "$nb"; then + summary="${summary}| ${name} | :white_circle: SKIPPED (no API key on fork PRs) |\n" + skipped=$((skipped + 1)) + continue + fi + echo "::group::Executing $nb" if .venv/bin/jupyter nbconvert --to notebook --execute \ --ExecutePreprocessor.kernel_name=notebook-env \ From d34f372584ec6199c2db2d607f4664230ed23e66 Mon Sep 17 00:00:00 2001 From: rryoung98 Date: Thu, 2 Jul 2026 23:33:16 -0500 Subject: [PATCH 2/2] Run CI workflows on PRs targeting staging branch Fork contributions land in staging first (API notebooks skipped without the secret), then an internal staging -> main PR executes the full suite with credentials. Co-Authored-By: Claude Fable 5 --- .github/workflows/check-notebook-license.yml | 2 +- .github/workflows/check-notebook-outputs.yml | 2 +- .github/workflows/execute-notebooks.yml | 2 +- .github/workflows/format.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-notebook-license.yml b/.github/workflows/check-notebook-license.yml index d6a6a8e..cf0a0c2 100644 --- a/.github/workflows/check-notebook-license.yml +++ b/.github/workflows/check-notebook-license.yml @@ -2,7 +2,7 @@ name: Check Notebook License Footers on: pull_request: - branches: ['main'] + branches: ['main', 'staging'] types: [opened, reopened, ready_for_review, synchronize] workflow_dispatch: diff --git a/.github/workflows/check-notebook-outputs.yml b/.github/workflows/check-notebook-outputs.yml index b2f993b..f31e4ae 100644 --- a/.github/workflows/check-notebook-outputs.yml +++ b/.github/workflows/check-notebook-outputs.yml @@ -2,7 +2,7 @@ name: Check Notebook Outputs on: pull_request: - branches: ['main'] + branches: ['main', 'staging'] types: [opened, reopened, ready_for_review, synchronize] workflow_dispatch: diff --git a/.github/workflows/execute-notebooks.yml b/.github/workflows/execute-notebooks.yml index d49b59b..398a3e7 100644 --- a/.github/workflows/execute-notebooks.yml +++ b/.github/workflows/execute-notebooks.yml @@ -2,7 +2,7 @@ name: Execute Notebooks on: pull_request: - branches: ['main'] + branches: ['main', 'staging'] types: [opened, reopened, ready_for_review, synchronize] workflow_dispatch: diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index f83b3a0..0486dc1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -2,7 +2,7 @@ name: Format on: pull_request: - branches: ['main'] + branches: ['main', 'staging'] types: [opened, reopened, ready_for_review, synchronize] workflow_dispatch: