Skip to content

Commit

Permalink
Exit notebook tests early on forks (Qiskit#1363)
Browse files Browse the repository at this point in the history
Suggestion on how to handle notebook testing on forks. Resolves Qiskit#967.

This PR proposes always failing the test on forks, with advice to merge
to another branch in this repo to test it before merging to the main
branch. While a little clunky, we very rarely get PRs from forks so this
is probably simplest for now. We can review the process if it starts
becoming a problem.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
  • Loading branch information
frankharkins and Eric-Arellano authored May 16, 2024
1 parent 2c989f9 commit b1990ea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/notebook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1990ea

Please sign in to comment.