diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2498ce12..ae67738a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,7 @@ on: paths-ignore: - "CHANGELOG.md" branches: [main] - # We use pull_request_target rather than pull_request - # because the latter does not let us comment on PR - # coming from a fork. - pull_request_target: + pull_request: branches: [main] schedule: - cron: "0 11 * * 4" @@ -33,11 +30,6 @@ concurrency: cancel-in-progress: true jobs: - comment-pr: - permissions: - pull-requests: write - uses: ./.github/workflows/step_comment-pr.yml - pre-commit: uses: ./.github/workflows/step_pre-commit.yml diff --git a/.github/workflows/step_comment-pr.yml b/.github/workflows/comment-pr.yml similarity index 55% rename from .github/workflows/step_comment-pr.yml rename to .github/workflows/comment-pr.yml index b3d8a52a..bf0fca48 100644 --- a/.github/workflows/step_comment-pr.yml +++ b/.github/workflows/comment-pr.yml @@ -1,14 +1,16 @@ -name: comment-pr -run-name: Comment PR +name: Comment PR on: - workflow_call: + pull_request_target: + +comment-pr: + permissions: + pull-requests: write jobs: comment-pr: runs-on: ubuntu-latest name: Comment PR - if: github.event_name == 'pull_request_target' steps: - name: Checkout uses: actions/checkout@v3 @@ -19,11 +21,11 @@ jobs: message: | Thank you for making this pull request. - Did you know? You can try it on Binder: [![Binder:lab](https://img.shields.io/badge/binder-jupyterlab-0172B2.svg)](https://mybinder.org/v2/gh/${{ github.repository }}/${{ github.head_ref }}?urlpath=lab/tree/demo/get_started.ipynb) or [![Binder:notebook](https://img.shields.io/badge/binder-notebook-0172B2.svg)](https://mybinder.org/v2/gh/${{ github.repository }}/${{ github.head_ref }}?filepath=demo). + Did you know? You can try it on Binder: [![Binder:lab](https://img.shields.io/badge/binder-jupyterlab-0172B2.svg)](https://mybinder.org/v2/gh/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}?urlpath=lab/tree/demo/get_started.ipynb) or [![Binder:notebook](https://img.shields.io/badge/binder-notebook-0172B2.svg)](https://mybinder.org/v2/gh/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}?filepath=demo). Also, the version of Jupytext developed in this PR can be installed with `pip`: ``` - pip install git+https://github.com/${{ github.repository }}.git@${{ github.head_ref }} + pip install git+${{ github.event.pull_request.head.repo.clone_url }}@${{ github.event.pull_request.head.ref }} ``` (this requires `nodejs`, see more at [Developing Jupytext](https://jupytext.readthedocs.io/en/latest/developing.html)) comment_tag: binder_link