Skip to content

Commit

Permalink
Add back --is-fork feature
Browse files Browse the repository at this point in the history
I've moved this to config to keep the args hidden from the rest of the
program.
  • Loading branch information
frankharkins committed Dec 3, 2024
1 parent 50ee4c9 commit 81a3bbf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/nb-tester/qiskit_docs_notebook_tester/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 81a3bbf

Please sign in to comment.