Skip to content

Commit

Permalink
Move the comment pr step to a distinct workflow (#1183)
Browse files Browse the repository at this point in the history
+ run the CI workflow on pull_requests
  • Loading branch information
mwouts authored Dec 2, 2023
1 parent e42bdb7 commit abc4f19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit abc4f19

Please sign in to comment.