diff --git a/.github/workflows/notebook-test.yml b/.github/workflows/notebook-test.yml index 65403479c67..d96e3c6bc7f 100644 --- a/.github/workflows/notebook-test.yml +++ b/.github/workflows/notebook-test.yml @@ -25,6 +25,24 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Exit early on forks + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + shell: python + run: | + raise SystemExit( + "We can't run this test on pull requests from forks." + "\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 must test out the notebook " + "locally 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." + ) + - name: Get all changed files id: all-changed-files uses: tj-actions/changed-files@af2816c65436325c50621100d67f6e853cd1b0f1