From 81a3bbfeea990a0e78002db705d34350208e075e Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Tue, 3 Dec 2024 13:38:13 +0000 Subject: [PATCH] Add back `--is-fork` feature I've moved this to config to keep the args hidden from the rest of the program. --- .../qiskit_docs_notebook_tester/config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/nb-tester/qiskit_docs_notebook_tester/config.py b/scripts/nb-tester/qiskit_docs_notebook_tester/config.py index 79d60e4a20a..064d8028bb7 100644 --- a/scripts/nb-tester/qiskit_docs_notebook_tester/config.py +++ b/scripts/nb-tester/qiskit_docs_notebook_tester/config.py @@ -164,6 +164,22 @@ def notebooks_to_execute(self) -> Iterator[Path]: ) continue + if self.args.is_fork: + print( + "⛔️ We can't run notebook tests on pull requests from forks " + "because of how GitHub Secrets work." + "\n\n" + "If you have write access to Qiskit/documentation, push to a new " + "branch there and make your pull request from that branch instead." + "\n\n" + "If you don't have write access, you should locally test out the notebooks you're modifying " + "by using the instructions in " + "https://github.com/Qiskit/documentation#execute-notebooks. " + "When this PR is approved, a maintainer will merge it to a new " + "branch in Qiskit/documentation, then make a PR from that branch " + "into main so it can pass CI.\n", + ) + sys.exit(1) yield path def should_patch(self, path: Path) -> bool: